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).
}
$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_"
public function getPrefixedDBKey(){
return '';
}
-}
\ No newline at end of file
+}
!!input
[[#section]]
!! result
-<a href="#section">#section</a>
+<p><a href="#section">#section</a>
+</p>
!! end
!! test
<a href="/wiki/Main_Page#section" title="Main Page">#section</a>
!! end
+!! test
+Anchor starting with underscore
+!!input
+[[#_ref|One]]
+!! result
+<p><a href="#_ref">One</a>
+</p>
+!! end
+
+!! test
+Id starting with underscore
+!!input
+<div id="_ref"></div>
+!! result
+<div id="_ref"></div>
+
+!! end
+
!! test
Space normalisation on autocomment (bug 22784)
!! options