Revert r25260; breaks several parser tests cases, seems to be borking up section...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 29 Aug 2007 16:01:23 +0000 (16:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 29 Aug 2007 16:01:23 +0000 (16:01 +0000)
8 previously passing test(s) now FAILING! :(
   * Basic section headings  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * Section headings with TOC  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * Handling of sections up to level 6 and beyond  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * TOC regression (bug 9764)  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * TOC with wgMaxTocLevel=3 (bug 6204)  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * Resolving duplicate section names  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * Fuzz testing: Parser14  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]
   * -{}- tags within headlines (within html for parserConvert())  [Introduced between 29-Aug-2007 15:27:48, 1.11alpha (r25250) and 29-Aug-2007 15:55:07, 1.11alpha (r25289)]

Sample:
--- /tmp/mwParser-557844546-expected    2007-08-29 15:55:46.000000000 +0000
+++ /tmp/mwParser-557844546-actual      2007-08-29 15:55:46.000000000 +0000
@@ -1,16 +1,16 @@
 <table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
 <ul>
-<li class="toclevel-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
+<li class="toclevel-1"><a href="#_Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
 <ul>

etc

RELEASE-NOTES
includes/Parser.php

index 832aa75..ce6666a 100644 (file)
@@ -424,8 +424,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11072) Fix regression in API image history query
 * (bug 10985) Resolved cached entries on Special:DoubleRedirects were being
   supressed, breaking paging - now strikes out "fixed" results
-* (bug 8393) <sup> and <sub> need to be preserved (without attributes) for
-  entries in the table of contents
 
 == API changes since 1.10 ==
 
index b2256b1..af358cd 100644 (file)
@@ -3641,20 +3641,12 @@ class Parser
                                                            "\$this->mInterwikiLinkHolders['texts'][\$1]",
                                                            $canonized_headline );
 
-                       # Strip out HTML (other than plain <sup> and <sub>: bug 8393)
-                       $tocline = preg_replace(
-                               array( '#<(?!/?(sup|sub)).*?'.'>#', '#<(/?(sup|sub)).*?'.'>#' ),
-                               array( '',                          '<$1>'),
-                               $canonized_headline
-                       );
-                       $tocline = trim( $tocline );
-
-                       # For the anchor, strip out HTML-y stuff period
-                       $canonized_headline = preg_replace( '/<.*?'.'>/', '', $canonized_headline );
-
+                       # strip out HTML
+                       $canonized_headline = preg_replace( '/<.*?' . '>/','',$canonized_headline );
+                       $tocline = trim( $canonized_headline );
                        # Save headline for section edit hint before it's escaped
                        $headline_hint = trim( $canonized_headline );
-                       $canonized_headline = Sanitizer::escapeId( $canonized_headline );
+                       $canonized_headline = Sanitizer::escapeId( $tocline );
                        $refers[$headlineCount] = $canonized_headline;
 
                        # count how many in assoc. array so we can track dupes in anchors