From: Aryeh Gregor Date: Wed, 29 Aug 2007 00:06:58 +0000 (+0000) Subject: (bug 8393) and need to be preserved (without attributes) for entries... X-Git-Tag: 1.31.0-rc.0~51612 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=ab3a00a097a46c81be1bcd5fed02163f981020e4;p=lhc%2Fweb%2Fwiklou.git (bug 8393) and need to be preserved (without attributes) for entries in the table of contents. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4e645c2a2e..c3ed0eda80 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..b2256b1a76 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3641,12 +3641,20 @@ 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 ); + # Save headline for section edit hint before it's escaped $headline_hint = trim( $canonized_headline ); - $canonized_headline = Sanitizer::escapeId( $tocline ); + $canonized_headline = Sanitizer::escapeId( $canonized_headline ); $refers[$headlineCount] = $canonized_headline; # count how many in assoc. array so we can track dupes in anchors