From 0cf4ddfc74dbf3dafaacf0cf46d27b1be6d05211 Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Fri, 17 May 2013 20:34:08 +0200 Subject: [PATCH] Make brackets in section edit links accessible to CSS Each is now wrapped in . The 'editsection-brackets' optional message, a hack added back in 2007 (43b05c00 / r23645), was removed and hardcoded again to facilitate this. Bug: 48256 Change-Id: Id27555c6dee250eafeefa97ae8927438fd65b8d7 --- RELEASE-NOTES-1.22 | 5 + includes/Skin.php | 8 +- languages/messages/MessagesEn.php | 2 - languages/messages/MessagesQqq.php | 1 - maintenance/language/messageTypes.inc | 1 - maintenance/language/messages.inc | 1 - tests/parser/parserTests.txt | 216 +++++++++++--------------- 7 files changed, 104 insertions(+), 130 deletions(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index da5425295e..8bf680b276 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -119,6 +119,8 @@ production. watchlists. * (bug 40518) mw.toolbar: Implemented mw.toolbar.addButtons for adding multiple button objects in one call. +* (bug 48256) Make brackets in section edit links accessible to CSS. + They are now wrapped in . === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one @@ -277,6 +279,9 @@ changes to languages because of Bugzilla reports. tantamount to a 'return true' in earlier versions of MediaWiki. * BREAKING CHANGE: The EditSectionLink hook was removed after being deprecated since MediaWiki 1.14. Use DoEditSectionLink instead. +* (bug 48256) The 'editsection-brackets' optional message was removed. + Section edit links' brackets can now be customized using CSS by + styling span.mw-editsection-bracket. == Compatibility == diff --git a/includes/Skin.php b/includes/Skin.php index a20100a155..de9c9dc928 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1584,9 +1584,11 @@ abstract class Skin extends ContextSource { ); # Add the brackets and the span and run the hook. - $result = wfMessage( 'editsection-brackets' )->rawParams( $link ) - ->inLanguage( $lang )->escaped(); - $result = "$result"; + $result = '' + . '[' + . $link + . ']' + . ''; wfRunHooks( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result, $lang ) ); return $result; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index b29c204f98..10fe5ea9b8 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -541,7 +541,6 @@ $preloadedMessages = array( 'disclaimers', 'edit', 'editsection', - 'editsection-brackets', 'editsectionhint', 'help', 'helppage', @@ -941,7 +940,6 @@ See [[Special:Version|version page]].', 'youhavenewmessagesmulti' => 'You have new messages on $1', 'newtalkseparator' => ', ', # do not translate or duplicate this message to other languages 'editsection' => 'edit', -'editsection-brackets' => '[$1]', # only translate this message to other languages if you have to change it 'editold' => 'edit', 'viewsourceold' => 'view source', 'editlink' => 'edit', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 7f4d1ee0dd..9b2814645a 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -755,7 +755,6 @@ The format is: "{{int:youhavenewmessagesmulti| [[MediaWiki:Newmessageslink/{{SUB 'editsection' => 'Display name of link to edit a section on a content page. Example: [{{MediaWiki:Editsection}}]. {{Identical|Edit}}', -'editsection-brackets' => '{{optional}}', 'editold' => '{{Identical|Edit}}', 'viewsourceold' => '{{Identical|View source}}', 'editlink' => 'Teks dari pranala yang terlihat di sebelah setiap templat yang dapat disunting (tidak diproteksi) pada daftar templat di bawah jendela penyuntingan. Lihat juga {{msg-mw|Viewsourcelink}}. diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index 0ec22e0017..b1d9c018bf 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -263,7 +263,6 @@ $wgIgnoredMessages = array( /** Optional messages, which may be translated only if changed in the target language. */ $wgOptionalMessages = array( 'linkprefix', - 'editsection-brackets', 'feed-atom', 'feed-rss', 'unit-pixel', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 900a35043e..2712fae61b 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -325,7 +325,6 @@ $wgMessageStructure = array( 'youhavenewmessagesmulti', 'newtalkseparator', 'editsection', - 'editsection-brackets', 'editold', 'viewsourceold', 'editlink', diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 34ec4086d3..d0f41e55e3 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -334,11 +334,11 @@ a

a


-

b[edit]

+

b[edit]

a


-

b[edit]

+

b[edit]

!! end @@ -351,7 +351,7 @@ Extra newlines between heading and content are swallowed [[a]] !! result -

b[edit]

+

b[edit]

a

!! end @@ -1525,7 +1525,6 @@ parsoid

[foo]

!! end - ### ### Parsoid-centric tests for testing RT edge cases for pre ### @@ -4631,7 +4630,6 @@ parsoid !! result !! end - ## ## XHTML tidiness ### @@ -5119,7 +5117,7 @@ List interrupted by empty line or heading
    • bar
-

A heading[edit]

+

A heading[edit]

  • Another list item
@@ -5186,7 +5184,6 @@ parsoid=wt2html,wt2wt !!end - ### ### Magic Words ### @@ -6226,8 +6223,8 @@ Bug 6563: Edit link generation for section shown by !! input {{includeonly section}} !! result -

Includeonly section[edit]

-

Section T-1[edit]

+

Includeonly section[edit]

+

Section T-1[edit]

!! end @@ -6253,7 +6250,7 @@ Bug 6563: Edit link generation for section suppressed by ==Section 1== !! result -

Section 1[edit]

+

Section 1[edit]

!! end @@ -7891,7 +7888,6 @@ Thumbnail image caption with a free URL and explicit alt !! end - !! test SVG thumbnails with no language set !! options @@ -7921,7 +7917,6 @@ SVG thumbnails with invalid language code
lang=invalid.language.code
!! end - !! test BUG 1887: A ISBN with a thumbnail !! input @@ -8309,7 +8304,6 @@ parsoid #
#

- ### ### Subpages ### @@ -8565,7 +8559,6 @@ parsoid !! end - ### ### Inter-language links ### @@ -8608,13 +8601,13 @@ More ===Smaller headline=== Blah blah !! result -

Headline 1[edit]

+

Headline 1[edit]

Some text

-

Headline 2[edit]

+

Headline 2[edit]

More

-

Smaller headline[edit]

+

Smaller headline[edit]

Blah blah

!! end @@ -8653,14 +8646,14 @@ Some text -

Headline 1[edit]

-

Subheadline 1[edit]

-
Skipping a level[edit]
-
Skipping a level[edit]
-

Headline 2[edit]

+

Headline 1[edit]

+

Subheadline 1[edit]

+
Skipping a level[edit]
+
Skipping a level[edit]
+

Headline 2[edit]

Some text

-

Another headline[edit]

+

Another headline[edit]

!! end @@ -8708,16 +8701,16 @@ Handling of sections up to level 6 and beyond -

Level 1 Heading[edit]

-

Level 2 Heading[edit]

-

Level 3 Heading[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 1 Heading[edit]

+

Level 2 Heading[edit]

+

Level 3 Heading[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]
!! end @@ -8750,12 +8743,12 @@ TOC regression (bug 9764) -

title 1[edit]

-

title 1.1[edit]

-

title 1.1.1[edit]

-

title 1.2[edit]

-

title 2[edit]

-

title 2.1[edit]

+

title 1[edit]

+

title 1.1[edit]

+

title 1.1.1[edit]

+

title 1.2[edit]

+

title 2[edit]

+

title 2.1[edit]

!! end @@ -8786,12 +8779,12 @@ wgMaxTocLevel=3 -

title 1[edit]

-

title 1.1[edit]

-

title 1.1.1[edit]

-

title 1.2[edit]

-

title 2[edit]

-

title 2.1[edit]

+

title 1[edit]

+

title 1.1[edit]

+

title 1.1.1[edit]

+

title 1.2[edit]

+

title 2[edit]

+

title 2.1[edit]

!! end @@ -8816,11 +8809,11 @@ wgMaxTocLevel=3
  • 2 Section 2
  • -

    Section 1[edit]

    -

    Section 1.1[edit]

    -

    Section 1.1.1[edit]

    -

    Section 1.1.1.1[edit]

    -

    Section 2[edit]

    +

    Section 1[edit]

    +

    Section 1.1[edit]

    +

    Section 1.1.1[edit]

    +

    Section 1.1.1.1[edit]

    +

    Section 2[edit]

    !! end @@ -8831,8 +8824,8 @@ Resolving duplicate section names == Foo bar == == Foo bar == !! result -

    Foo bar[edit]

    -

    Foo bar[edit]

    +

    Foo bar[edit]

    +

    Foo bar[edit]

    !! end @@ -8842,8 +8835,8 @@ Resolving duplicate section names with differing case (bug 10721) == Foo bar == == Foo Bar == !! result -

    Foo bar[edit]

    -

    Foo Bar[edit]

    +

    Foo bar[edit]

    +

    Foo Bar[edit]

    !! end @@ -8862,10 +8855,10 @@ __NOTOC__ {{sections}} ==Section 4== !! result -

    Section 0[edit]

    -

    Section 1[edit]

    -

    Section 2[edit]

    -

    Section 4[edit]

    +

    Section 0[edit]

    +

    Section 1[edit]

    +

    Section 2[edit]

    +

    Section 4[edit]

    !! end @@ -8886,7 +8879,7 @@ Link inside a section heading !! input ==Section with a [[Main Page|link]] in it== !! result -

    Section with a link in it[edit]

    +

    Section with a link in it[edit]

    !! end @@ -8908,9 +8901,9 @@ __TOC__
  • 2 title 2
  • -

    title 1[edit]

    -

    title 1.1[edit]

    -

    title 2[edit]

    +

    title 1[edit]

    +

    title 1.1[edit]

    +

    title 2[edit]

    !! end @@ -8932,10 +8925,10 @@ The line above must have a trailing space! --> But just in case it doesn't... !! result -

    =[edit]

    +

    =[edit]

    The line above must have a trailing space!

    -

    =[edit]

    +

    =[edit]

    But just in case it doesn't...

    !! end @@ -8971,19 +8964,19 @@ section 5
  • 5 text " text
  • -

    text > text[edit]

    +

    text > text[edit]

    section 1

    -

    text < text[edit]

    +

    text < text[edit]

    section 2

    -

    text & text[edit]

    +

    text & text[edit]

    section 3

    -

    text ' text[edit]

    +

    text ' text[edit]

    section 4

    -

    text " text[edit]

    +

    text " text[edit]

    section 5

    !! end @@ -9005,10 +8998,10 @@ Headers with excess '=' characters
  • 4 =italic heading
  • -

    foo=[edit]

    -

    =foo[edit]

    -

    italic heading=[edit]

    -

    =italic heading[edit]

    +

    foo=[edit]

    +

    =foo[edit]

    +

    italic heading=[edit]

    +

    =italic heading[edit]

    !! end @@ -10334,7 +10327,7 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! result -

    onmouseover=[edit]

    +

    onmouseover=[edit]

    http://

    Contents

    • 1 onmouseover=
    • @@ -10349,7 +10342,7 @@ Fuzz testing: Parser14-table ==a== {| STYLE=__TOC__ !! result -

      a[edit]

      +

      a[edit]

      @@ -12146,7 +12139,7 @@ Inclusion of !userCanEdit() content !! input {{MediaWiki:Fake}} !! result -

      header[edit]

      +

      header[edit]

      !! end @@ -12177,12 +12170,12 @@ Out-of-order TOC heading levels
    -

    2[edit]

    -
    6[edit]
    -

    3[edit]

    -

    1[edit]

    -
    5[edit]
    -

    2[edit]

    +

    2[edit]

    +
    6[edit]
    +

    3[edit]

    +

    1[edit]

    +
    5[edit]
    +

    2[edit]

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

    Naslov[уреди]

    +

    Naslov[уреди]

    !! end @@ -12881,7 +12874,7 @@ Morwen/13: Unclosed link followed by heading !! result

    [[link

    -

    heading[edit]

    +

    heading[edit]

    !! end @@ -12905,7 +12898,7 @@ HHP2.2: Heuristics for headings in preprocessor parenthetical structures !! result

    {{foo|

    -

    heading[edit]

    +

    heading[edit]

    !! end @@ -13759,7 +13752,7 @@ __TOC__
  • 1 Lost episodes
  • -

    Lost episodes[edit]

    +

    Lost episodes[edit]

    !! end @@ -13776,7 +13769,7 @@ __TOC__
  • 1 should be bold then normal text
  • -

    should be bold then normal text[edit]

    +

    should be bold then normal text[edit]

    !! end @@ -13793,7 +13786,7 @@ __TOC__
  • 1 Image
  • -

    Image Foobar.jpg[edit]

    +

    Image Foobar.jpg[edit]

    !! end @@ -13810,7 +13803,7 @@ __TOC__
  • 1 Quote
  • -

    Quote
    [edit]

    +

    Quote
    [edit]

    !! end @@ -13829,7 +13822,7 @@ QED
  • 1 Proof: 2 < 3
  • -

    Proof: 2 < 3[edit]

    +

    Proof: 2 < 3[edit]

    Hanc marginis exiguitas non caperet. QED

    @@ -13849,8 +13842,8 @@ __TOC__
  • 2 Foo Bar
  • -

    Foo Bar[edit]

    -

    Foo
    Bar
    [edit]

    +

    Foo Bar[edit]

    +

    Foo
    Bar
    [edit]

    !! end @@ -13868,8 +13861,8 @@ __TOC__
  • 2 b">Evilbye
  • -

    Hello[edit]

    -

    b">Evilbye[edit]

    +

    Hello[edit]

    +

    b">Evilbye[edit]

    !! end @@ -13896,11 +13889,11 @@ __TOC__
  • 5 Attributes after dir on these span tags must be deleted from the TOC
  • -

    C++[edit]

    -

    זבנג![edit]

    -

    The attributes on these span tags must be deleted from the TOC[edit]

    -

    All attributes on these span tags must be deleted from the TOC[edit]

    -

    Attributes after dir on these span tags must be deleted from the TOC[edit]

    +

    C++[edit]

    +

    זבנג![edit]

    +

    The attributes on these span tags must be deleted from the TOC[edit]

    +

    All attributes on these span tags must be deleted from the TOC[edit]

    +

    Attributes after dir on these span tags must be deleted from the TOC[edit]

    !! end @@ -13917,7 +13910,7 @@ title=[[Main Page]] !! input {{int:Bug32057}} !! result -

    Headline text[edit]

    +

    Headline text[edit]

    !! end @@ -14019,7 +14012,7 @@ nowiki inside link inside heading (bug 18295) !! input ==[[foo|xyz]]== !! result -

    xyz[edit]

    +

    xyz[edit]

    !! end @@ -14185,7 +14178,6 @@ HttP://MediaWiki.Org/

    !! end - ### ### Parsoids-specific tests ### Parsoid-PHP parser incompatibilities @@ -14603,15 +14595,10 @@ Headings: 1. Nested inside html parsoid !! input ==foo== - ===foo=== - ====foo==== - =====foo===== - ======foo====== - =======foo======= !! result

    =foo=

    @@ -14629,10 +14616,8 @@ parsoid !! input =foo= *bar - =foo= =bar - =foo= =bar= !! result @@ -14657,19 +14642,12 @@ Headings: 4a. No escaping needed (testing just h1 and h2) parsoid !! input ==foo= - =foo== - = =foo= = - ==foo= bar= - ===foo== - ==foo=== - =''=''foo== - === !! result

    =foo

    @@ -14703,15 +14681,10 @@ Headings: 5. Empty headings parsoid !! input == - ==== - ====== - ======== - ========== - ============ !! result

    @@ -15819,7 +15792,6 @@ parsoid

    !!end - TODO: more images more tables -- 2.20.1