From: Brion Vibber Date: Wed, 29 Aug 2007 16:01:23 +0000 (+0000) Subject: Revert r25260; breaks several parser tests cases, seems to be borking up section... X-Git-Tag: 1.31.0-rc.0~51601 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=106c4bc74cbe045b6629cae5aee5c8c6d6f9b359;p=lhc%2Fweb%2Fwiklou.git Revert r25260; breaks several parser tests cases, seems to be borking up section IDs. 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 @@

Contents

    -
  • 1 Level 1 Heading +
  • 1 Level 1 Heading
      etc --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 832aa75e58..ce6666aa8f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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) and need to be preserved (without attributes) for - entries in the table of contents == API changes since 1.10 == diff --git a/includes/Parser.php b/includes/Parser.php index b2256b1a76..af358cd9e1 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3641,20 +3641,12 @@ class Parser "\$this->mInterwikiLinkHolders['texts'][\$1]", $canonized_headline ); - # Strip out HTML (other than plain and : 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