r101632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101631‎ | r101632 | r101633 >
Date:15:50, 2 November 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use Parser::guessSectionNameFromWikiText() instead of EditPage::sectionAnchor()
Modified paths:
  • /trunk/extensions/ActiveAbstract/AbstractFilter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ActiveAbstract/AbstractFilter.php
@@ -201,6 +201,8 @@
202202 * @fixme check for explicit __NOTOC__
203203 */
204204 function _sectionLinks( $rev ) {
 205+ global $wgParser;
 206+
205207 $text = Revision::getRevisionText( $rev );
206208 $secs =
207209 preg_split(
@@ -213,7 +215,7 @@
214216 $inside = preg_replace( '/^=+\s*(.*?)\s*=+/', '$1', $secs[$i] );
215217 $stripped = $this->_stripMarkup( $inside ); // strip internal markup and <h[1-6]>
216218 $header = UtfNormal::cleanUp( $stripped );
217 - $anchor = EditPage::sectionAnchor( $header );
 219+ $anchor = $wgParser->guessSectionNameFromWikiText( $header );
218220 $url = $this->title->getCanonicalUrl() . $anchor;
219221 $headers[$header] = $url;
220222 }

Status & tagging log