Multiple whitespace in TOC anchors is now stripped, for consistency with the link...
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 2 Jun 2009 19:32:51 +0000 (19:32 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 2 Jun 2009 19:32:51 +0000 (19:32 +0000)
RELEASE-NOTES
includes/parser/Parser.php

index 5f69186..c764c4c 100644 (file)
@@ -183,6 +183,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 19017) TOC level calculation error in an odd case
 * (bug 18999) CSS update for RTL interwiki links
 * (bug 18925) history.js removes class names of list elements on initialization
+* Multiple whitespace in TOC anchors is now stripped, for consistency with the
+  link from the edit comment
 
 == API changes in 1.16 ==
 
index 27f55f7..9d6e98e 100644 (file)
@@ -3543,6 +3543,7 @@ class Parser
 
                        # For the anchor, strip out HTML-y stuff period
                        $safeHeadline = preg_replace( '/<.*?'.'>/', '', $safeHeadline );
+                       $safeHeadline = preg_replace( '/[ _]+/', ' ', $safeHeadline );
                        $safeHeadline = trim( $safeHeadline );
 
                        # Save headline for section edit hint before it's escaped