From: Aryeh Gregor Date: Sun, 28 Dec 2008 00:05:14 +0000 (+0000) Subject: Prepend x to section ids not starting with [a-z] X-Git-Tag: 1.31.0-rc.0~43736 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=ef5697878059abd307a9f4a56dc926c91333f043;p=lhc%2Fweb%2Fwiklou.git Prepend x to section ids not starting with [a-z] This will break any preexisting links to such sections (other than those generated by the software, of course). There should be no parser test regressions. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 00739e726d..9f384749f5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -456,6 +456,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 13835) Fix rendering of {{filepath:Wiki.png|nowiki}} * (bug 16772) Special:Upload now correctly rejects files with spaces in the file extension (e.g. Foo. jpg). +* Ensure that all HTML id's generated for headers begin with a letter. === API changes in 1.14 === diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e4d63af28b..853d05f79b 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3615,7 +3615,7 @@ class Parser # Save headline for section edit hint before it's escaped $headlineHint = $safeHeadline; - $safeHeadline = Sanitizer::escapeId( $safeHeadline ); + $safeHeadline = Sanitizer::escapeId( $safeHeadline, Sanitizer::NONE ); # HTML names must be case-insensitively unique (bug 10721) $arrayKey = strtolower( $safeHeadline ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 44fe01f2d1..8e514e4737 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -3607,10 +3607,10 @@ Handling of sections up to level 6 and beyond
  • 1.1.1.1.1 Level 5 Heading
  • @@ -3629,10 +3629,10 @@ Handling of sections up to level 6 and beyond

    [edit] Level 4 Heading

    [edit] Level 5 Heading
    [edit] Level 6 Heading
    -
    [edit] = Level 7 Heading=
    -
    [edit] == Level 8 Heading==
    -
    [edit] === Level 9 Heading===
    -
    [edit] ==== Level 10 Heading====
    +
    [edit] = Level 7 Heading=
    +
    [edit] == Level 8 Heading==
    +
    [edit] === Level 9 Heading===
    +
    [edit] ==== Level 10 Heading====
    !! end @@ -6578,26 +6578,26 @@ Out-of-order TOC heading levels !! result

    Contents

    -

    [edit] 2

    -
    [edit] 6
    -

    [edit] 3

    -

    [edit] 1

    -
    [edit] 5
    -

    [edit] 2

    +

    [edit] 2

    +
    [edit] 6
    +

    [edit] 3

    +

    [edit] 1

    +
    [edit] 5
    +

    [edit] 2

    !! end @@ -6843,7 +6843,7 @@ language=sr variant=sr-ec !! input == -{Naslov}- == !! result -

    [уреди] Naslov

    +

    [уреди] Naslov

    !! end