Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -8248,7 +8248,8 @@ |
8249 | 8249 | !!input |
8250 | 8250 | [[#section]] |
8251 | 8251 | !! result |
8252 | | -<a href="#section">#section</a> |
| 8252 | +<p><a href="#section">#section</a> |
| 8253 | +</p> |
8253 | 8254 | !! end |
8254 | 8255 | |
8255 | 8256 | !! test |
— | — | @@ -8263,6 +8264,24 @@ |
8264 | 8265 | !! end |
8265 | 8266 | |
8266 | 8267 | !! 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 |
8267 | 8286 | Space normalisation on autocomment (bug 22784) |
8268 | 8287 | !! options |
8269 | 8288 | comment |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2672,7 +2672,7 @@ |
2673 | 2673 | } |
2674 | 2674 | $fragment = strstr( $dbkey, '#' ); |
2675 | 2675 | if ( false !== $fragment ) { |
2676 | | - $this->setFragment( preg_replace( '/^#_*/', '#', $fragment ) ); |
| 2676 | + $this->setFragment( $fragment ); |
2677 | 2677 | $dbkey = substr( $dbkey, 0, strlen( $dbkey ) - strlen( $fragment ) ); |
2678 | 2678 | # remove whitespace again: prevents "Foo_bar_#" |
2679 | 2679 | # becoming "Foo_bar_" |
— | — | @@ -4259,4 +4259,4 @@ |
4260 | 4260 | public function getPrefixedDBKey(){ |
4261 | 4261 | return ''; |
4262 | 4262 | } |
4263 | | -} |
\ No newline at end of file |
| 4263 | +} |