X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FparserTests.txt;h=a30db63492adcfb85ac5f0ed305a74c908bb6525;hb=739b6549393288d864d71c0e369f68dde5964383;hp=221d257a8b2ed91f433381b05a7aa94394ffd433;hpb=14cab769b9bb101a1fc8d6cefa0176397c5c9476;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 221d257a8b..a30db63492 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -33,6 +33,23 @@ Main Page blah blah !! endarticle +!!article +Template:Foo +!!text +FOO +!!endarticle + +!! article +Template:Blank +!! text +!! endarticle + +!! article +Template:! +!! text +| +!! endarticle + ### ### Basic tests ### @@ -81,6 +98,7 @@ Italics and bold * plain''italic'''bold-italic'''''plain * plain'''bold''bold-italic'''''plain * plain l'''italic''plain +* plain l''''bold''' plain !! result !! end @@ -255,7 +274,7 @@ everything starting with < followed by !-- until the first -- and > we see, that wouldn't be valid XML however, since in XML -- has to terminate a comment -->--> !! result -

--> +

-->

!! end @@ -264,7 +283,7 @@ Comment semantics: nesting !! input --> !! result -

--> +

-->

!! end @@ -276,6 +295,26 @@ Comment semantics: unclosed comment at end !! end +!! test +Comment in template title +!! input +{{foo}} +!! result +

FOO +

+!! end + +!! test +Comment on its own line post-expand +!! input +a +{{blank}} +b +!! result +

a +

b +

+!! end ### ### Preformatted text @@ -422,7 +461,7 @@ Definition list with wikilink containing colon !! input ; [[Help:FAQ]]: The least-read page on Wikipedia !! result -
Help:FAQ
The least-read page on Wikipedia +
Help:FAQ
The least-read page on Wikipedia
!! end @@ -497,11 +536,11 @@ External links: numbered !! input Numbered: [http://example.com] Numbered: [http://example.net] -Numbered: [http://example.org] +Numbered: [http://example.com] !! result

Numbered: [1] Numbered: [2] -Numbered: [3] +Numbered: [3]

!!end @@ -848,7 +887,7 @@ External links: wiki links within external link (Bug 3695) !! input [http://example.com [[wikilink]] embedded in ext link] !! result -

wikilink embedded in ext link +

wikilink embedded in ext link

!! end @@ -983,7 +1022,23 @@ External link containing double-single-quotes in text embedded in italics (bug 4

!! end +!! test +URL-encoding in URL functions (single parameter) +!! input +{{localurl:Some page|amp=&}} +!! result +

/index.php?title=Some_page&amp=& +

+!! end +!! test +URL-encoding in URL functions (multiple parameters) +!! input +{{localurl:Some page|q=?&=&}} +!! result +

/index.php?title=Some_page&q=?&amp=& +

+!! end ### ### Quotes @@ -1209,16 +1264,18 @@ Invalid attributes in table cell (bug 1830) !! end -# FIXME: this one has incorrect tag nesting still. +# FIXME: It's not clear at all that this is the result we want, but the actual +# output right now is invalid XML, so clearly something is wrong. The result +# specified here is now valid XML, which is an improvement . . . !! test -TODO: Table security: embedded pipes (http://mail.wikipedia.org/pipermail/wikitech-l/2006-April/034637.html) +Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) !! input {| | |[ftp://|x||]" onmouseover="alert(document.cookie)">test !! result -
[1]" onmouseover="alert(document.cookie)">test +[1]" onmouseover="alert(document.cookie)">test
@@ -1261,7 +1318,34 @@ Broken link !! input [[Zigzagzogzagzig]] !! result -

Zigzagzogzagzig +

Zigzagzogzagzig +

+!! end + +!! test +Broken link with fragment +!! input +[[Zigzagzogzagzig#zug]] +!! result +

Zigzagzogzagzig#zug +

+!! end + +!! test +Special page link with fragment +!! input +[[Special:Version#anchor]] +!! result +

Special:Version#anchor +

+!! end + +!! test +Nonexistent special page link with fragment +!! input +[[Special:ThisNameWillHopefullyNeverBeUsed#anchor]] +!! result +

Special:ThisNameWillHopefullyNeverBeUsed#anchor

!! end @@ -1277,9 +1361,9 @@ xxx[[main Page]], xxx[[Main Page]], Xxx[[main Page]] XXX[[main Page]], XXX[[Main !! test Link with suffix !! input -[[Main Page]]xxx, [[Main Page]]XXX +[[Main Page]]xxx, [[Main Page]]XXX, [[Main Page]]!!! !! result -

Main Pagexxx, Main PageXXX +

Main Pagexxx, Main PageXXX, Main Page!!!

!! end @@ -1315,7 +1399,7 @@ Link to namespaces !! input [[Talk:Parser testing]], [[Meta:Disclaimers]] !! result -

Talk:Parser testing, Meta:Disclaimers +

Talk:Parser testing, Meta:Disclaimers

!! end @@ -1324,7 +1408,7 @@ Piped link to namespace !! input [[Meta:Disclaimers|The disclaimers]] !! result -

The disclaimers +

The disclaimers

!! end @@ -1342,7 +1426,7 @@ Link containing % (not as a hex sequence) !! input [[7% Solution]] !! result -

7% Solution +

7% Solution

!! end @@ -1351,7 +1435,7 @@ Link containing % as a single hex sequence interpreted to char !! input [[7%25 Solution]] !! result -

7% Solution +

7% Solution

!!end @@ -1370,7 +1454,7 @@ Example for such a section: == < == !! input [[%23%3c]][[%23%3e]] !! result -

#<#> +

#<#>

!! end @@ -1384,7 +1468,7 @@ Link containing "<#" and ">#" as a hex sequences !! end !! test -TODO: Link containing double-single-quotes '' (bug 4598) +Link containing double-single-quotes '' (bug 4598) !! input [[Lista d''e paise d''o munno]] !! result @@ -1397,7 +1481,7 @@ Link containing double-single-quotes '' in text (bug 4598 sanity check) !! input Some [[Link|pretty ''italics'' and stuff]]! !! result -

Some pretty italics and stuff! +

Some pretty italics and stuff!

!! end @@ -1406,16 +1490,16 @@ Link containing double-single-quotes '' in text embedded in italics (bug 4598 sa !! input ''Some [[Link|pretty ''italics'' and stuff]]! !! result -

Some pretty italics and stuff! +

Some pretty italics and stuff!

!! end !! test Plain link to URL !! input -[[http://www.example.org]] +[[http://www.example.com]] !! result -

[[1]] +

[[1]]

!! end @@ -1426,16 +1510,16 @@ Plain link to URL # ---- # I'm changing it to match the current output--it arguably makes more # sense in the light of the test above. Old expected result was: -#

Piped link to URL: an example URL +#

Piped link to URL: an example URL #

# But I think this test is bordering on "garbage in, garbage out" anyway. # -- wtm !! test Piped link to URL !! input -Piped link to URL: [[http://www.example.org|an example URL]] +Piped link to URL: [[http://www.example.com|an example URL]] !! result -

Piped link to URL: [example URL] +

Piped link to URL: [example URL]

!! end @@ -1470,6 +1554,34 @@ title=[[Main Page]]

!! end +!! article +00 +!! text +This is 00. +!! endarticle + +!!test +Self-link to numeric title +!!options +title=[[0]] +!!input +[[0]] +!!result +

0 +

+!!end + +!!test +Link to numeric-equivalent title +!!options +title=[[0]] +!!input +[[00]] +!!result +

00 +

+!!end + !! test inside a link !! input @@ -1522,6 +1634,53 @@ Interwiki link with fragment (bug 2130)

!! end +!! test +Interlanguage link +!! input +Blah blah blah +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Double interlanguage link +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Interlanguage link, with prefix links +!! options +language=ln +!! input +Blah blah blah +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + +!! test +Double interlanguage link, with prefix links (bug 8897) +!! options +language=ln +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +

Blah blah blah +

+!! end + + ## ## XHTML tidiness ### @@ -1812,7 +1971,7 @@ Magic Word: {{NUMBEROFARTICLES}} !! input {{NUMBEROFARTICLES}} !! result -

1 +

2

!! end @@ -1937,7 +2096,7 @@ Namespace -1 {{ns:-1}} !! end !! test -Namespace Project {{ns:User}} +Namespace User {{ns:User}} !! input {{ns:User}} !! result @@ -1945,6 +2104,64 @@ Namespace Project {{ns:User}}

!! end +!! test +Namespace User talk {{ns:User_talk}} +!! input +{{ns:User_talk}} +!! result +

User talk +

+!! end + +!! test +Namespace User talk {{ns:uSeR tAlK}} +!! input +{{ns:uSeR tAlK}} +!! result +

User talk +

+!! end + +!! test +Namespace File {{ns:File}} +!! input +{{ns:File}} +!! result +

File +

+!! end + +!! test +Namespace File {{ns:Image}} +!! input +{{ns:Image}} +!! result +

File +

+!! end + +!! test +Namespace (lang=de) Benutzer {{ns:User}} +!! options +language=de +!! input +{{ns:User}} +!! result +

Benutzer +

+!! end + +!! test +Namespace (lang=de) Benutzer Diskussion {{ns:3}} +!! options +language=de +!! input +{{ns:3}} +!! result +

Benutzer Diskussion +

+!! end + ### ### Magic links @@ -1954,7 +2171,7 @@ Magic links: internal link to RFC (bug 479) !! input [[RFC 123]] !! result -

RFC 123 +

RFC 123

!! end @@ -1963,7 +2180,7 @@ Magic links: RFC (bug 479) !! input RFC 822 !! result -

RFC 822 +

RFC 822

!! end @@ -1972,7 +2189,7 @@ Magic links: ISBN (bug 1937) !! input ISBN 0-306-40615-2 !! result -

ISBN 0-306-40615-2 +

ISBN 0-306-40615-2

!! end @@ -1994,7 +2211,7 @@ Nonexistant template !! input {{thistemplatedoesnotexist}} !! result -

Template:Thistemplatedoesnotexist +

Template:Thistemplatedoesnotexist

!! end @@ -2176,7 +2393,7 @@ Template with thumb image (with link in description) {{paramtest| param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} !! result -This is a test template with parameter +This is a test template with parameter !! end @@ -2285,7 +2502,7 @@ Template infinite loop !! input {{loop1}} !! result -

loop1 +

Template loop detected: Template:Loop1

!! end @@ -2450,6 +2667,64 @@ Foozarbar

!! end +!! article +Template:Includeonly section +!! text + +==Includeonly section== + +==Section T-1== +!!endarticle + +!! test +Bug 6563: Edit link generation for section shown by +!! input +{{includeonly section}} +!! result +

[edit] Includeonly section

+

[edit] Section T-1

+ +!! end + +# Uses same input as the contents of [[Template:Includeonly section]] +!! test +Bug 6563: Section extraction for section shown by +!! options +section=T-2 +!! input + +==Includeonly section== + +==Section T-2== +!! result +==Section T-2== +!! end + +!! test +Bug 6563: Edit link generation for section suppressed by +!! input + +==Includeonly section== + +==Section 1== +!! result +

[edit] Section 1

+ +!! end + +!! test +Bug 6563: Section extraction for section suppressed by +!! options +section=1 +!! input + +==Includeonly section== + +==Section 1== +!! result +==Section 1== +!! end + ### ### Pre-save transform tests ### @@ -2808,7 +3083,7 @@ msg !! end !! test -TODO: message transform: in transcluded template (bug 4926) +message transform: in transcluded template (bug 4926) !! options msg !! input @@ -2818,7 +3093,7 @@ Foobar !! end !! test -TODO: message transform: in transcluded template (bug 4926) +message transform: in transcluded template (bug 4926) !! options msg !! input @@ -2834,7 +3109,7 @@ msg !! input {{#special:Recentchanges}} !! result -Special:Recentchanges +Special:RecentChanges !! end !! test @@ -2855,7 +3130,7 @@ Simple image !! input [[Image:foobar.jpg]] !! result -

Image:foobar.jpg +

Image:foobar.jpg

!! end @@ -2864,36 +3139,101 @@ Right-aligned image !! input [[Image:foobar.jpg|right]] !! result -
+
!! end +!! test +Simple image (using File: namespace, now canonical) +!! input +[[File:foobar.jpg]] +!! result +

File:foobar.jpg +

+!! end + !! test Image with caption !! input [[Image:foobar.jpg|right|Caption text]] !! result -
Caption text
+
Caption text
+ +!! end + +!! test +Image with link parameter, wiki target +!! input +[[Image:foobar.jpg|link=Target page]] +!! result +

+

+!! end + +!! test +Image with link parameter, URL target +!! input +[[Image:foobar.jpg|link=http://example.com/]] +!! result +

+

+!! end +!! test +Image with empty link parameter +!! input +[[Image:foobar.jpg|link=]] +!! result +

+

!! end + + !! test Image with frame and link !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] !! result -
This is a test image Main Page
This is a test image Main Page
+
This is a test image Main Page
+ +!! end + +!! test +Image with frame and link and explicit alt +!! input +[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] +!! result +
Altitude
This is a test image Main Page
+ +!! end + +!! test +Image with wiki markup in implicit alt +!! input +[[Image:Foobar.jpg|testing '''bold''' in alt]] +!! result +

testing bold in alt +

+!! end +!! test +Image with wiki markup in explicit alt +!! input +[[Image:Foobar.jpg|alt=testing '''bold''' in alt]] +!! result +

testing bold in alt +

!! end !! test Link to image page- image page normally doesn't exists, hence edit link -TODO: Add test with existing image page -#

Image:test +Add test with existing image page +#

Image:test !! input [[:Image:test]] !! result -

Image:test +

Image:test

!! end @@ -2902,7 +3242,7 @@ Frameless image caption with a free URL !! input [[Image:foobar.jpg|http://example.com]] !! result -

http://example.com +

http://example.com

!! end @@ -2911,7 +3251,16 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result - + + +!! end + +!! test +Thumbnail image caption with a free URL and explicit alt +!! input +[[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] +!! result + !! end @@ -2920,7 +3269,7 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result - + !! end @@ -2929,7 +3278,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
This is RFC 12354
+
This is RFC 12354
!! end @@ -2938,7 +3287,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result - + !! end @@ -2948,7 +3297,7 @@ so math is not stripped and turns up as escaped <math> tags. !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
<math>2+2</math>
<math>2+2</math>
+
<math>2+2</math>
!! end @@ -2959,7 +3308,7 @@ math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
2 + 2
2 + 2
+
2 + 2
!! end @@ -2969,7 +3318,7 @@ BUG 648: Frameless image caption with a link !! input [[Image:foobar.jpg|text with a [[link]] in it]] !! result -

text with a link in it +

text with a link in it

!! end @@ -2978,7 +3327,7 @@ BUG 648: Frameless image caption with a link (suffix) !! input [[Image:foobar.jpg|text with a [[link]]foo in it]] !! result -

text with a linkfoo in it +

text with a linkfoo in it

!! end @@ -2987,7 +3336,7 @@ BUG 648: Frameless image caption with an interwiki link !! input [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] !! result -

text with a MeatBall:Link in it +

text with a MeatBall:Link in it

!! end @@ -2996,7 +3345,7 @@ BUG 648: Frameless image caption with a piped interwiki link !! input [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] !! result -

text with a link in it +

text with a link in it

!! end @@ -3005,7 +3354,7 @@ Escape HTML special chars in image alt text !! input [[Image:foobar.jpg|& < > "]] !! result -

& < > " +

& < > "

!! end @@ -3014,7 +3363,7 @@ BUG 499: Alt text should have Ӓ, not &1234; !! input [[Image:foobar.jpg|♀]] !! result -

♀ +

♀

!! end @@ -3032,7 +3381,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
This is a caption with another Image:Icon.png inside it!
This is a caption with another Image:Icon.png inside it!
+
This is a caption with another File:Icon.png inside it!
!! end @@ -3042,7 +3391,7 @@ Image caption containing a newline [[Image:Foobar.jpg|This *is some text]] !! result -

This *is some text +

This *is some text

!!end @@ -3052,7 +3401,7 @@ Bug 3090: External links other than http: in image captions !! input [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] !! result -
This caption has irc and Secure ext links in it.
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end @@ -3093,7 +3442,7 @@ Disabled subpages !! input [[/subpage]] !! result -

/subpage +

/subpage

!! end @@ -3104,7 +3453,7 @@ subpage title=[[Page]] !! input {{/Subpage}} !! result -

Page/Subpage +

Page/Subpage

!! end @@ -3122,7 +3471,7 @@ Link to category !! input [[:Category:MediaWiki User's Guide]] !! result -

Category:MediaWiki User's Guide +

Category:MediaWiki User's Guide

!! end @@ -3133,7 +3482,16 @@ cat !! input [[Category:MediaWiki User's Guide]] !! result -MediaWiki User's Guide +MediaWiki User's Guide +!! end + +!! test +PAGESINCATEGORY invalid title fatal (r33546 fix) +!! input +{{PAGESINCATEGORY:}} +!! result +

0 +

!! end ### @@ -3165,13 +3523,13 @@ More ===Smaller headline=== Blah blah !! result -

[edit] Headline 1

+

[edit] Headline 1

Some text

-

[edit] Headline 2

+

[edit] Headline 2

More

-

[edit] Smaller headline

+

[edit] Smaller headline

Blah blah

!! end @@ -3210,14 +3568,14 @@ Some text -

[edit] 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

Some text

-

[edit] Another headline

+

[edit] Another headline

!! end @@ -3249,10 +3607,10 @@ Handling of sections up to level 6 and beyond
  • 1.1.1.1.1 Level 5 Heading
  • @@ -3265,52 +3623,137 @@ Handling of sections up to level 6 and beyond -

    [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] 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====
    !! end !! test -Resolving duplicate section names +TOC regression (bug 9764) !! input -== Foo bar == -== Foo bar == +== title 1 == +=== title 1.1 === +==== title 1.1.1 ==== +=== title 1.2 === +== title 2 == +=== title 2.1 === !! result -

    [edit] Foo bar

    -

    [edit] Foo bar

    +

    Contents

    + +
    +

    [edit] title 1

    +

    [edit] title 1.1

    +

    [edit] title 1.1.1

    +

    [edit] title 1.2

    +

    [edit] title 2

    +

    [edit] title 2.1

    !! end -!! article -Template:sections -!! text -===Section 1=== -==Section 2== -!! endarticle - !! test -Template with sections, __NOTOC__ +TOC with wgMaxTocLevel=3 (bug 6204) +!! options +wgMaxTocLevel=3 !! input -__NOTOC__ -==Section 0== -{{sections}} -==Section 4== +== title 1 == +=== title 1.1 === +==== title 1.1.1 ==== +=== title 1.2 === +== title 2 == +=== title 2.1 === !! result -

    [edit] Section 0

    -

    [edit] Section 1

    -

    [edit] Section 2

    -

    [edit] Section 4

    - -!! end - +

    Contents

    + +
    +

    [edit] title 1

    +

    [edit] title 1.1

    +

    [edit] title 1.1.1

    +

    [edit] title 1.2

    +

    [edit] title 2

    +

    [edit] title 2.1

    + +!! end + +!! test +Resolving duplicate section names +!! input +== Foo bar == +== Foo bar == +!! result +

    [edit] Foo bar

    +

    [edit] Foo bar

    + +!! end + +!! test +Resolving duplicate section names with differing case (bug 10721) +!! input +== Foo bar == +== Foo Bar == +!! result +

    [edit] Foo bar

    +

    [edit] Foo Bar

    + +!! end + +!! article +Template:sections +!! text +===Section 1=== +==Section 2== +!! endarticle + +!! test +Template with sections, __NOTOC__ +!! input +__NOTOC__ +==Section 0== +{{sections}} +==Section 4== +!! result +

    [edit] Section 0

    +

    [edit] Section 1

    +

    [edit] Section 2

    +

    [edit] Section 4

    + +!! end + !! test __NOEDITSECTION__ keyword !! input @@ -3318,8 +3761,8 @@ __NOEDITSECTION__ ==Section 1== ==Section 2== !! result -

    Section 1

    -

    Section 2

    +

    Section 1

    +

    Section 2

    !! end @@ -3328,17 +3771,40 @@ Link inside a section heading !! input ==Section with a [[Main Page|link]] in it== !! result -

    [edit] Section with a link in it

    +

    [edit] Section with a link in it

    !! end +!! test +TOC regression (bug 12077) +!! input +__TOC__ +== title 1 == +=== title 1.1 === +== title 2 == +!! result +

    Contents

    + +
    +

    [edit] title 1

    +

    [edit] title 1.1

    +

    [edit] title 2

    + +!! end !! test BUG 1219 URL next to image (good) !! input http://example.com [[Image:foobar.jpg]] !! result -

    http://example.com Image:foobar.jpg +

    http://example.com Image:foobar.jpg

    !!end @@ -3347,7 +3813,7 @@ BUG 1219 URL next to image (broken) !! input http://example.com[[Image:foobar.jpg]] !! result -

    http://example.comImage:foobar.jpg +

    http://example.comImage:foobar.jpg

    !!end @@ -3533,7 +3999,7 @@ Image link to nonexistent file (bug 1850 - good) !! input [[Image:No such.jpg]] !! result -

    Image:No such.jpg +

    File:No such.jpg

    !! end @@ -3542,7 +4008,7 @@ Image link to nonexistent file (bug 1850 - good) !! input [[:Image:No such.jpg]] !! result -

    Image:No such.jpg +

    Image:No such.jpg

    !! end @@ -3711,7 +4177,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) !! input {{div style|">}} !! result -
    Magic div
    +
    <script>alert(document.cookie)</script>">Magic div
    !! end @@ -3720,7 +4186,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309) !! input {{div style|" >}} !! result -
    Magic div
    +
    <script>alert(document.cookie)</script>">Magic div
    !! end @@ -3747,7 +4213,7 @@ Bug 2304: HTML attribute safety (bold) !! input
    !! result -
    +
    !! end @@ -3849,7 +4315,7 @@ MSIE CSS safety test: comment in url !! input
    evil
    !! result -
    evil
    +
    evil
    !! end @@ -3858,7 +4324,7 @@ MSIE CSS safety test: comment in expression !! input
    evil4
    !! result -
    evil4
    +
    evil4
    !! end @@ -3984,7 +4450,7 @@ array(0) { !! test -Parser hook: case insensetive +Parser hook: case insensitive !! input input !! result @@ -3998,7 +4464,7 @@ array(0) { !! test -Parser hook: case insensetive, redux +Parser hook: case insensitive, redux !! input input !! result @@ -4196,7 +4662,7 @@ Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id= !! input byte[[#æ: v|backlink]] !! result -

    bytebacklink +

    bytebacklink

    !! end @@ -4256,6 +4722,34 @@ Self closed html pairs (bug 5487) # # +!! test +Punctuation: nbsp before exclamation +!! input +C'est grave ! +!! result +

    C'est grave ! +

    +!! end + +!! test +Punctuation: CSS !important (bug 11874) +!! input +
    important
    +!! result +
    important
    + +!!end + +!! test +Punctuation: CSS ! important (bug 11874; with space after) +!! input +
    important
    +!! result +
    important
    + +!!end + + !! test HTML bullet list, closed tags (bug 5497) !! input @@ -4272,7 +4766,7 @@ HTML bullet list, closed tags (bug 5497) !! end !! test -TODO: HTML bullet list, unclosed tags (bug 5497) +HTML bullet list, unclosed tags (bug 5497) !! input
    • One @@ -4302,7 +4796,7 @@ HTML ordered list, closed tags (bug 5497) !! end !! test -TODO: HTML ordered list, unclosed tags (bug 5497) +HTML ordered list, unclosed tags (bug 5497) !! input
      1. One @@ -4342,7 +4836,7 @@ HTML nested bullet list, closed tags (bug 5497) !! end !! test -TODO: HTML nested bullet list, open tags (bug 5497) +HTML nested bullet list, open tags (bug 5497) !! input
        • One @@ -4390,7 +4884,7 @@ HTML nested ordered list, closed tags (bug 5497) !! end !! test -TODO: HTML nested ordered list, open tags (bug 5497) +HTML nested ordered list, open tags (bug 5497) !! input
          1. One @@ -4469,7 +4963,7 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! result -

            [edit] onmouseover=

            +

            [edit] onmouseover=

            http://

            Contents

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

              [edit] a

              +

              [edit] a

              @@ -4557,9 +5051,9 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT | !! result - -} > -
              +{{{| +}}}} > +
              MOVE YOUR MOUSE CURSOR OVER THIS TEXT
              @@ -4570,11 +5064,16 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT !! end -# Known to produce bad XML for now +# Note: the current result listed for this is not what the original one was, +# but the original bug was JavaScript injection, which is fixed in any case. +# It's not clear that the original result listed was any more correct than the +# current one. Original result: +#

              {{{| +#

              +#
            • +# }}}blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE !!test Fuzz testing: Parser25 (bug 6055) -!! options -noxml !! input {{{ | @@ -4582,9 +5081,8 @@ noxml > }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE !! result -
            • -blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE - +

              <LI CLASS=blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE +

              !! end !!test @@ -4622,7 +5120,7 @@ Fuzz testing: image with bogus manual thumbnail !!input [[Image:foobar.jpg|thumbnail= ]] !!result -
              +
              Error creating thumbnail:
              !!end @@ -4636,7 +5134,7 @@ Fuzz testing: encoded newline in generated HTML replacements (bug 6577) !! end !! test -TODO: Parsing optional HTML elements (Bug 6171) +Parsing optional HTML elements (Bug 6171) !! options !! input
            • @@ -4702,7 +5200,7 @@ New wiki paragraph !! end !! test -TODO: Inline HTML vs wiki block nesting +Inline HTML vs wiki block nesting !! input Bold paragraph @@ -4713,14 +5211,19 @@ New wiki paragraph

              !! end - +# Original result was this: +#

              boldboldbolditalics +#

              +# While that might be marginally more intuitive, maybe, the six-apostrophe +# construct is clearly pathological and the result stated here (which is what +# the parser actually does) is about as reasonable as anything. !!test -TODO: Mixing markup for italics and bold +Mixing markup for italics and bold !! options !! input '''bold''''''bold''bolditalics''''' !! result -

              boldboldbolditalics +

              'bold'boldbolditalics

              !! end @@ -4759,6 +5262,42 @@ Special page transclusion twice (bug 5021) !! end +!! test +Transclusion of default MediaWiki message +!! input +{{MediaWiki:Mainpage}} +!!result +

              Main Page +

              +!! end + +!! test +Transclusion of nonexistent MediaWiki message +!! input +{{MediaWiki:Mainpagexxx}} +!!result +

              MediaWiki:Mainpagexxx +

              +!! end + +!! test +Transclusion of MediaWiki message with underscore +!! input +{{MediaWiki:history_short}} +!! result +

              History +

              +!! end + +!! test +Transclusion of MediaWiki message with space +!! input +{{MediaWiki:history short}} +!! result +

              History +

              +!! end + !! test Invalid header with following text !! input @@ -5048,8 +5587,8 @@ Section extraction test with comment after heading (section 1) section=1 !! input ==a== -==legal== -==b== +==b== +==c== !! result ==a== !! end @@ -5060,10 +5599,10 @@ Section extraction test with comment after heading (section 2) section=2 !! input ==a== -==legal== -==b== +==b== +==c== !! result -==legal== +==b== !! end !! test @@ -5092,102 +5631,79 @@ section=2 !! end +# Formerly testing for bug 2587, now resolved by the use of unmarked sections +# instead of respecting commented sections !! test -Section extraction prefixed by comment (section 1) (bug 2587) +Section extraction prefixed by comment (section 1) !! options section=1 !! input ==sec1== ==sec2== !!result -==sec1== +==sec2== !!end !! test -Section extraction prefixed by comment (section 2) (bug 2587) +Section extraction prefixed by comment (section 2) !! options section=2 !! input ==sec1== ==sec2== !!result -==sec2== + !!end +# Formerly testing for bug 2607, now resolved by the use of unmarked sections +# instead of respecting HTML-style headings !! test -Section extraction, mixed wiki and html (section 1) (bug 2607) +Section extraction, mixed wiki and html (section 1) !! options section=1 !! input -

              1

              +

              unmarked

              +unmarked +==1== one ==2== two -==3== -three !! result -

              1

              +==1== one !! end !! test -Section extraction, mixed wiki and html (section 2) (bug 2607) +Section extraction, mixed wiki and html (section 2) !! options section=2 !! input -

              1

              +

              unmarked

              +unmarked +==1== one ==2== two -==3== -three !! result ==2== two !! end +# Formerly testing for bug 3342 !! test -Section extraction, heading surrounded by (bug 3342) +Section extraction, heading surrounded by !! options section=1 !! input -==a== -text +==unmarked== +==marked== !! result -==a== -text +==marked== !!end -!! test -Section extraction, HTML heading subsections (bug 5272) -!! options -section=1 -!! input -

              a

              -

              aa

              -

              b

              -!! result -

              a

              -

              aa

              -!! end - -!! test -Section extraction, HTML headings should be ignored in extensions (bug 3476) -!! options -section=2 -!! input -

              a

              - -

              not b

              -
              -

              b

              -!! result -

              b

              -!! end - !! test Section replacement test (section 0) !! options @@ -5518,119 +6034,86 @@ start xxx !! end - !! test -Section extraction, HTML headings not at line boundaries (section 0) +Section replacement test with initial whitespace (bug 13728) !! options -section=0 +replace=2,"xxx" !! input -

              Evil

              blah blah blah - -evil blah - -

              Nice

              - -nice blah - -extra evil

              Extra nasty

              - -extra nasty + Preformatted initial line +==a== +===a=== !! result + Preformatted initial line +==a== +xxx !! end + !! test -Section extraction, HTML headings not at line boundaries (section 1) +Section extraction, heading followed by pre with 20 spaces (bug 6398) !! options section=1 !! input -

              Evil

              blah blah blah - -evil blah - -

              Nice

              - -nice blah - -extra evil

              Extra nasty

              - -extra nasty +==a== + a !! result -

              Evil

              blah blah blah - -evil blah +==a== + a !! end !! test -Section extraction, HTML headings not at line boundaries (section 2) +Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check) !! options -section=2 +section=1 !! input -

              Evil

              blah blah blah - -evil blah - -

              Nice

              - -nice blah - -extra evil

              Extra nasty

              - -extra nasty +==a== + a !! result -

              Nice

              - -nice blah - -extra evil +==a== + a !! end + !! test -Section extraction, HTML headings not at line boundaries (section 3) +Section extraction,
               around bogus header (bug 10309)
               !! options
              -section=3
              +noxml section=2
               !! input
              -

              Evil

              blah blah blah - -evil blah - -

              Nice

              - -nice blah - -extra evil

              Extra nasty

              +== Section One == +
              +=======
              +
              -extra nasty +== Section Two == +stuff !! result -

              Extra nasty

              - -extra nasty +== Section Two == +stuff !! end - !! test -Section extraction, heading followed by pre with 20 spaces (bug 6398) +Section replacement,
               around bogus header (bug 10309)
               !! options
              -section=1
              +noxml replace=2,"xxx"
               !! input
              -==a==
              -                    a
              -!! result
              -==a==
              -                    a
              -!! end
              +== Section One ==
              +
              +=======
              +
              -!! test -Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check) -!! options -section=1 -!! input -==a== - a +== Section Two == +stuff !! result -==a== - a +== Section One == +
              +=======
              +
              + +xxx !! end + + !! test Handling of in URLs !! input @@ -5643,7 +6126,7 @@ Handling of in URLs !!end !! test -TODO: 5 quotes, code coverage +1 line +5 quotes, code coverage +1 line !! input ''''' !! result @@ -5695,7 +6178,7 @@ Say the magic word
            • Talk
            • -
            • Template:Dynamic +
            • Template:Dynamic
            • !! end @@ -5715,19 +6198,47 @@ image4 |300px| centre * image6 !! result -
              - - - - - - + + + + + + + + + + + !! end @@ -5756,7 +6267,7 @@ ISBN code coverage !! input ISBN 978-0-1234-56 789 !! result -

              ISBN 978-0-1234-56 789 +

              ISBN 978-0-1234-56 789

              !! end @@ -5774,7 +6285,7 @@ Double ISBN !! input ISBN ISBN 1234567890 !! result -

              ISBN ISBN 1234567890 +

              ISBN ISBN 1234567890

              !! end @@ -5783,7 +6294,7 @@ Double RFC !! input RFC RFC 1234 !! result -

              RFC RFC 1234 +

              RFC RFC 1234

              !! end @@ -5792,7 +6303,7 @@ Double RFC with a wiki link !! input RFC [[RFC 1234]] !! result -

              RFC RFC 1234 +

              RFC RFC 1234

              !! end @@ -5801,7 +6312,7 @@ RFC code coverage !! input RFC 983 987 !! result -

              RFC 983 987 +

              RFC 983 987

              !! end @@ -5810,7 +6321,7 @@ Centre-aligned image !! input [[Image:foobar.jpg|centre]] !! result -
              +
              !!end @@ -5819,7 +6330,7 @@ None-aligned image !! input [[Image:foobar.jpg|none]] !! result -
              +
              !!end @@ -5828,7 +6339,34 @@ Width + Height sized image (using px) (height is ignored) !! input [[Image:foobar.jpg|640x480px]] !! result -

              +

              +

              +!!end + +!! test +Width-sized image (using px, no following whitespace) +!! input +[[Image:foobar.jpg|640px]] +!! result +

              +

              +!!end + +!! test +Width-sized image (using px, with following whitespace - test regression from r39467) +!! input +[[Image:foobar.jpg|640px ]] +!! result +

              +

              +!!end + +!! test +Width-sized image (using px, with preceding whitespace - test regression from r39467) +!! input +[[Image:foobar.jpg| 640px]] +!! result +

              !!end @@ -5845,16 +6383,16 @@ Another italics / bold test # XML error: Mismatched tag at byte 6120: # ...
              -
              -
              - + + + !!end @@ -5862,11 +6400,11 @@ TODO: dt/dd/dl test # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. !! test -TODO: Images with the "|" character in the comment +Images with the "|" character in the comment !! input [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] !! result -
              An external URL
              An external URL
              +
              An external URL
              An external URL
              !!end @@ -5897,7 +6435,7 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../|L2]] !! result -

              L2 +

              L2

              !! end @@ -5909,7 +6447,7 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../]] !! result -

              Subpage test/L1/L2 +

              Subpage test/L1/L2

              !! end @@ -5923,33 +6461,29 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../../|L1]]2 !! result -

              L1 +

              L1

              !! end - -# Question: should result be "/index.php?title=Subpage_test/L1&action=edit" instead? !! test -TODO: Parents of subpages, two levels up, without trailing slash or name. +Parents of subpages, two levels up, without trailing slash or name. !! options subpage title=[[Subpage test/L1/L2/L3]] !! input [[../..]] !! result -

              ../.. +

              [[../..]]

              !! end -# Question: Why should the link text in the above test be "../..", yet in this test the "../.." part is silently dropped? -# Current result:

              /// !! test -TODO: Parents of subpages, two levels up, with lots of extra trailing slashes. +Parents of subpages, two levels up, with lots of extra trailing slashes. !! options subpage title=[[Subpage test/L1/L2/L3]] !! input [[../../////]] !! result -

              Subpage test/L1 +

              ///

              !! end @@ -5968,7 +6502,7 @@ Definition list code coverage !! end !! test -TODO: Don't fall for the self-closing div +Don't fall for the self-closing div !! input
              hello world
              !! result @@ -5981,7 +6515,7 @@ MSGNW magic word !! input {{MSGNW:msg}} !! result -

              [[:Template:Msg]] +

              [[:Template:Msg]]

              !! end @@ -5990,13 +6524,13 @@ RAW magic word !! input {{RAW:QUERTY}} !! result -

              Template:QUERTY +

              Template:QUERTY

              !! end # This isn't needed for XHTML conformance, but would be handy as a fallback security measure !! test -TODO: Always escape literal '>' in output, not just after '<' +Always escape literal '>' in output, not just after '<' !! input ><> !! result @@ -6027,7 +6561,7 @@ Inclusion of !userCanEdit() content !! input {{MediaWiki:Fake}} !! result -

              [edit] header

              +

              [edit] header

              !! end @@ -6044,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 @@ -6083,7 +6617,7 @@ ISBN with space-delimited number !! input ISBN 92 9017 032 8 !! result -

              ISBN 92 9017 032 8 +

              ISBN 92 9017 032 8

              !! end @@ -6108,7 +6642,7 @@ ISBN 1234567890 ISBN 12345678901 !! result

              ISBN 123456789 -

              ISBN 1234567890 +

              ISBN 1234567890

              ISBN 12345678901

              !! end @@ -6121,8 +6655,8 @@ ISBN 1-234-56789-0 - 2006 ISBN 1 234 56789 0 - 2006 !! result -

              ISBN 1-234-56789-0 - 2006 -

              ISBN 1 234 56789 0 - 2006 +

              ISBN 1-234-56789-0 - 2006 +

              ISBN 1 234 56789 0 - 2006

              !! end @@ -6250,7 +6784,7 @@ language=sr cat !! input [[:Category:МедиаWики Усер'с Гуиде]] !! result -MediaWiki User's Guide +MediaWiki User's Guide !! end @@ -6309,7 +6843,7 @@ language=sr variant=sr-ec !! input == -{Naslov}- == !! result -

              [уреди] Naslov

              +

              [уреди] Naslov

              !! end @@ -6373,6 +6907,331 @@ Fridrih IV je car.

              !! end +!!article +Template:Bullet +!!text +* Bar +!!endarticle + +!! test +Bug 529: Uncovered bullet +!! input +* Foo {{bullet}} +!! result +
              • Foo +
              • Bar +
              + +!! end + +!! test +Bug 529: Uncovered table already at line-start +!! input +x + +{{table}} +y +!! result +

              x +

              + + + + +
              1 2 +
              3 4 +
              +

              y +

              +!! end + +!! test +Bug 529: Uncovered bullet in parser function result +!! input +* Foo {{lc:{{bullet}} }} +!! result +
              • Foo +
              • bar +
              + +!! end + +!! test +Bug 5678: Double-parsed template argument +!! input +{{lc:{{{1}}}|hello}} +!! result +

              {{{1}}} +

              +!! end + +!! test +Bug 5678: Double-parsed template invocation +!! input +{{lc:{{paramtest {{!}} param = hello }} }} +!! result +

              {{paramtest | param = hello }} +

              +!! end + +!! test +Morwen/13: Unclosed link followed by heading +!! input +[[link +==heading== +!! result +

              [[link +

              +

              [edit] heading

              + +!! end + +!! test +HHP2.1: Heuristics for headings in preprocessor parenthetical structures +!! input +{{foo| +=heading= +!! result +

              {{foo| +

              +

              heading

              + +!! end + +!! test +HHP2.2: Heuristics for headings in preprocessor parenthetical structures +!! input +{{foo| +==heading== +!! result +

              {{foo| +

              +

              [edit] heading

              + +!! end + +!! test +Tildes in comments +!! options +pst +!! input + +!! result + +!! end + +!! test +Paragraphs inside divs (no extra line breaks) +!! input +
              Line one + +Line two
              +!! result +
              Line one +Line two
              + +!! end + +!! test +Paragraphs inside divs (extra line break on open) +!! input +
              +Line one + +Line two
              +!! result +
              +

              Line one +

              +Line two
              + +!! end + +!! test +Paragraphs inside divs (extra line break on close) +!! input +
              Line one + +Line two +
              +!! result +
              Line one +

              Line two +

              +
              + +!! end + +!! test +Paragraphs inside divs (extra line break on open and close) +!! input +
              +Line one + +Line two +
              +!! result +
              +

              Line one +

              Line two +

              +
              + +!! end + +# Bug 6200:
              should behave like
              with respect to line breaks +!! test +Bug 6200: paragraphs inside blockquotes (no extra line breaks) +!! input +
              Line one + +Line two
              +!! result +
              Line one +Line two
              + +!! end + +!! test +Bug 6200: paragraphs inside blockquotes (extra line break on open) +!! input +
              +Line one + +Line two
              +!! result +
              +

              Line one +

              +Line two
              + +!! end + +!! test +Bug 6200: paragraphs inside blockquotes (extra line break on close) +!! input +
              Line one + +Line two +
              +!! result +
              Line one +

              Line two +

              +
              + +!! end + +!! test +Bug 6200: paragraphs inside blockquotes (extra line break on open and close) +!! input +
              +Line one + +Line two +
              +!! result +
              +

              Line one +

              Line two +

              +
              + +!! end + +!! test +Paragraphs inside blockquotes/divs (no extra line breaks) +!! input +
              Line one + +Line two
              +!! result +
              Line one +Line two
              + +!! end + +!! test +Paragraphs inside blockquotes/divs (extra line break on open) +!! input +
              +Line one + +Line two
              +!! result +
              +

              Line one +

              +Line two
              + +!! end + +!! test +Paragraphs inside blockquotes/divs (extra line break on close) +!! input +
              Line one + +Line two +
              +!! result +
              Line one +

              Line two +

              +
              + +!! end + +!! test +Paragraphs inside blockquotes/divs (extra line break on open and close) +!! input +
              +Line one + +Line two +
              +!! result +
              +

              Line one +

              Line two +

              +
              + +!! end + +!! test +Interwiki links trounced by replaceExternalLinks after early LinkHolderArray expansion +!! options +wgLinkHolderBatchSize=0 +!! input +[[meatball:1]] +[[meatball:2]] +[[meatball:3]] +!! result +

              meatball:1 +meatball:2 +meatball:3 +

              +!! end + +!! test +Free external link invading image caption +!! input +[[Image:Foobar.jpg|thumb|http://x|hello]] +!! result +
              hello
              + +!! end + +!! test +Bug 15196: localised external link numbers +!! options +language=fa +!! input +[http://en.wikipedia.org/] +!! result +

              [Û±] +

              +!! end # #