r25260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25259‎ | r25260 | r25261 >
Date:00:06, 29 August 2007
Author:simetrical
Status:old
Tags:
Comment:
(bug 8393) <sup> and <sub> need to be preserved (without attributes) for entries in the table of contents.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -3641,12 +3641,20 @@
36423642 "\$this->mInterwikiLinkHolders['texts'][\$1]",
36433643 $canonized_headline );
36443644
3645 - # strip out HTML
3646 - $canonized_headline = preg_replace( '/<.*?' . '>/','',$canonized_headline );
3647 - $tocline = trim( $canonized_headline );
 3645+ # Strip out HTML (other than plain <sup> and <sub>: bug 8393)
 3646+ $tocline = preg_replace(
 3647+ array( '#<(?!/?(sup|sub)).*?'.'>#', '#<(/?(sup|sub)).*?'.'>#' ),
 3648+ array( '', '<$1>'),
 3649+ $canonized_headline
 3650+ );
 3651+ $tocline = trim( $tocline );
 3652+
 3653+ # For the anchor, strip out HTML-y stuff period
 3654+ $canonized_headline = preg_replace( '/<.*?'.'>/', '', $canonized_headline );
 3655+
36483656 # Save headline for section edit hint before it's escaped
36493657 $headline_hint = trim( $canonized_headline );
3650 - $canonized_headline = Sanitizer::escapeId( $tocline );
 3658+ $canonized_headline = Sanitizer::escapeId( $canonized_headline );
36513659 $refers[$headlineCount] = $canonized_headline;
36523660
36533661 # count how many in assoc. array so we can track dupes in anchors
Index: trunk/phase3/RELEASE-NOTES
@@ -424,6 +424,8 @@
425425 * (bug 11072) Fix regression in API image history query
426426 * (bug 10985) Resolved cached entries on Special:DoubleRedirects were being
427427 supressed, breaking paging - now strikes out "fixed" results
 428+* (bug 8393) <sup> and <sub> need to be preserved (without attributes) for
 429+ entries in the table of contents
428430
429431 == API changes since 1.10 ==
430432

Follow-up revisions

RevisionCommit summaryAuthorDate
r25291Revert r25260; breaks several parser tests cases, seems to be borking up sect...brion16:01, 29 August 2007
r25292Reinstate r25260 with fix (missing trim()). No additional parser tests are b...simetrical16:10, 29 August 2007
r25303Merged revisions 25215-25302 via svnmerge from...david07:10, 30 August 2007

Status & tagging log