From: Platonides Date: Tue, 5 Apr 2011 22:38:37 +0000 (+0000) Subject: Revert r68358. Causes bug 27474. X-Git-Tag: 1.31.0-rc.0~31004 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=c6c92be5c6b8c34d0bd138d5d5904d6d56d8622c;p=lhc%2Fweb%2Fwiklou.git Revert r68358. Causes bug 27474. Added parser test. Added another parser test for what it seems to try to account for but that in fact doesn't change when trying to achieve, since ids don't seem to be affected when flipping $wgHtml5 and $wgExperimentalHtmlIds (so r68358 seems useless). --- diff --git a/includes/Title.php b/includes/Title.php index 7a1919e139..08e3695f25 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2672,7 +2672,7 @@ class Title { } $fragment = strstr( $dbkey, '#' ); if ( false !== $fragment ) { - $this->setFragment( preg_replace( '/^#_*/', '#', $fragment ) ); + $this->setFragment( $fragment ); $dbkey = substr( $dbkey, 0, strlen( $dbkey ) - strlen( $fragment ) ); # remove whitespace again: prevents "Foo_bar_#" # becoming "Foo_bar_" @@ -4259,4 +4259,4 @@ class BadTitle extends Title { public function getPrefixedDBKey(){ return ''; } -} \ No newline at end of file +} diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index d7996f427e..e6b7ea492a 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -8248,7 +8248,8 @@ title=[[Main Page]] !!input [[#section]] !! result -#section +

#section +

!! end !! test @@ -8262,6 +8263,24 @@ title=[[Main Page]] #section !! end +!! test +Anchor starting with underscore +!!input +[[#_ref|One]] +!! result +

One +

+!! end + +!! test +Id starting with underscore +!!input +
+!! result +
+ +!! end + !! test Space normalisation on autocomment (bug 22784) !! options