r85481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85480‎ | r85481 | r85482 >
Date:22:38, 5 April 2011
Author:platonides
Status:ok
Tags:
Comment:
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).
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTests.txt
@@ -8248,7 +8248,8 @@
82498249 !!input
82508250 [[#section]]
82518251 !! result
8252 -<a href="#section">#section</a>
 8252+<p><a href="#section">#section</a>
 8253+</p>
82538254 !! end
82548255
82558256 !! test
@@ -8263,6 +8264,24 @@
82648265 !! end
82658266
82668267 !! test
 8268+Anchor starting with underscore
 8269+!!input
 8270+[[#_ref|One]]
 8271+!! result
 8272+<p><a href="#_ref">One</a>
 8273+</p>
 8274+!! end
 8275+
 8276+!! test
 8277+Id starting with underscore
 8278+!!input
 8279+<div id="_ref"></div>
 8280+!! result
 8281+<div id="_ref"></div>
 8282+
 8283+!! end
 8284+
 8285+!! test
82678286 Space normalisation on autocomment (bug 22784)
82688287 !! options
82698288 comment
Index: trunk/phase3/includes/Title.php
@@ -2672,7 +2672,7 @@
26732673 }
26742674 $fragment = strstr( $dbkey, '#' );
26752675 if ( false !== $fragment ) {
2676 - $this->setFragment( preg_replace( '/^#_*/', '#', $fragment ) );
 2676+ $this->setFragment( $fragment );
26772677 $dbkey = substr( $dbkey, 0, strlen( $dbkey ) - strlen( $fragment ) );
26782678 # remove whitespace again: prevents "Foo_bar_#"
26792679 # becoming "Foo_bar_"
@@ -4259,4 +4259,4 @@
42604260 public function getPrefixedDBKey(){
42614261 return '';
42624262 }
4263 -}
\ No newline at end of file
 4263+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r85582Revert unintended change to this parserTest in r85481platonides21:46, 6 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68358(bug 18431) Remove initial whitespace from fragment in Title::secureAndSplit()conrad14:08, 21 June 2010
r83061Disable $wgExperimentalHtmlIds again by default...simetrical01:35, 2 March 2011
r83720Backport r83061 "Disable $wgExperimentalHtmlIds again by default"...simetrical21:00, 11 March 2011

Status & tagging log