From b57bce94c52fbec1e56c69429047f422c4d8cb49 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Tue, 2 Jun 2009 19:32:51 +0000 Subject: [PATCH] Multiple whitespace in TOC anchors is now stripped, for consistency with the link from the edit comment. --- RELEASE-NOTES | 2 ++ includes/parser/Parser.php | 1 + 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5f6918662f..c764c4c494 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 27f55f7d98..9d6e98eb97 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 -- 2.20.1