From: Aryeh Gregor Date: Wed, 29 Aug 2007 16:10:36 +0000 (+0000) Subject: Reinstate r25260 with fix (missing trim()). No additional parser tests are broken... X-Git-Tag: 1.31.0-rc.0~51600 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=1e3b8049eb7e42de03e17562ac5a31cf6f1ffb27;p=lhc%2Fweb%2Fwiklou.git Reinstate r25260 with fix (missing trim()). No additional parser tests are broken relative to trunk. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ce6666aa8f..832aa75e58 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -424,6 +424,8 @@ 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 af358cd9e1..32e7f2a86b 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3641,12 +3641,21 @@ class Parser "\$this->mInterwikiLinkHolders['texts'][\$1]", $canonized_headline ); - # strip out HTML - $canonized_headline = preg_replace( '/<.*?' . '>/','',$canonized_headline ); - $tocline = trim( $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 ); + $canonized_headline = trim( $canonized_headline ); + # Save headline for section edit hint before it's escaped - $headline_hint = trim( $canonized_headline ); - $canonized_headline = Sanitizer::escapeId( $tocline ); + $headline_hint = $canonized_headline; + $canonized_headline = Sanitizer::escapeId( $canonized_headline ); $refers[$headlineCount] = $canonized_headline; # count how many in assoc. array so we can track dupes in anchors