X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FparserTests.txt;h=43463c0e31b3932a757cb1b2a6727faad9c9e98c;hb=06e2f914846efb62ee2165e5b6a6a36485e3177a;hp=7662627dc05d226e147c54a502af598f8f81806b;hpb=0fb6151c6899e78abf66b01123247a6d2df42b21;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 7662627dc0..43463c0e31 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -18,7 +18,8 @@ # subpage enable subpages (disabled by default) # noxml don't check for XML well formdness # title=[[XXX]] run test using article title XXX -# language=XXX set content language to XXX for this test +# language=XXX set content language to XXX for this test +# variant=XXX set the variant of language for this test (eg zh-tw) # disabled do not run test # # For testing purposes, temporary articles can created: @@ -32,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 ### @@ -80,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 @@ -157,6 +177,7 @@ nowiki 3 !! end + ### ### Comments ### @@ -253,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 @@ -262,7 +283,7 @@ Comment semantics: nesting !! input --> !! result -

--> +

-->

!! end @@ -274,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 @@ -312,6 +353,56 @@ And a link !! end +!! test +Regression with preformatted in
+!! input +
+ Blah +
+!! result +
+
Blah
+
+
+ +!! end + +!! test +
 with attributes (bug 3202)
+!! input
+
Bluescreen of WikiDeath
+!! result +
Bluescreen of WikiDeath
+ +!! end + +!! test +
 with width attribute (bug 3202)
+!! input
+
Narrow screen goodies
+!! result +
Narrow screen goodies
+ +!! end + +!! test +
 with forbidden attribute (bug 3202)
+!! input
+
Narrow screen goodies
+!! result +
Narrow screen goodies
+ +!! end + +!! test +
 with forbidden attribute values (bug 3202)
+!! input
+
Narrow screen goodies
+!! result +
Narrow screen goodies
+ +!! end + ### ### Definition lists ### @@ -326,7 +417,7 @@ Simple definition !! end !! test -Simple definition +Definition list for indentation only !! input : Indented text !! result @@ -350,7 +441,7 @@ Definition list with URL link !! input ; http://example.com/ : definition !! result -
http://example.com/ 
definition +
http://example.com/ 
definition
!! end @@ -360,7 +451,7 @@ Definition list with bracketed URL link !! input ;[http://www.example.com/ Example]:Something about it !! result -
Example
Something about it +
Example
Something about it
!! end @@ -370,18 +461,18 @@ 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 # At Brion's and JeLuF's insistence... :) !! test -Definition list with wikilink containing colon +Definition list with news link containing colon !! input ; news:alt.wikipedia.rox: This isn't even a real newsgroup! !! result -
news:alt.wikipedia.rox
This isn't even a real newsgroup! +
news:alt.wikipedia.rox
This isn't even a real newsgroup!
!! end @@ -391,7 +482,7 @@ Malformed definition list with colon !! input ; news:alt.wikipedia.rox -- don't crash or enter an infinite loop !! result -
news:alt.wikipedia.rox -- don't crash or enter an infinite loop +
news:alt.wikipedia.rox -- don't crash or enter an infinite loop
!! end @@ -401,7 +492,7 @@ Definition lists: colon in external link text !! input ; [http://www.wikipedia2.org/ Wikipedia : The Next Generation]: OK, I made that up !! result -
Wikipedia : The Next Generation
OK, I made that up +
Wikipedia : The Next Generation
OK, I made that up
!! end @@ -436,7 +527,7 @@ External links: non-bracketed !! input Non-bracketed: http://example.com !! result -

Non-bracketed: http://example.com +

Non-bracketed: http://example.com

!! end @@ -445,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: [1] +Numbered: [2] +Numbered: [3]

!!end @@ -458,7 +549,7 @@ External links: specified text !! input Specified text: [http://example.com link] !! result -

Specified text: link +

Specified text: link

!!end @@ -467,7 +558,7 @@ External links: trail !! input Linktrails should not work for external links: [http://example.com link]s !! result -

Linktrails should not work for external links: links +

Linktrails should not work for external links: links

!! end @@ -476,7 +567,7 @@ External links: dollar sign in URL !! input http://example.com/1$2345 !! result -

http://example.com/1$2345 +

http://example.com/1$2345

!! end @@ -485,7 +576,7 @@ External links: dollar sign in URL (named) !! input [http://example.com/1$2345] !! result -

[1] +

[1]

!!end @@ -494,7 +585,7 @@ External links: open square bracket forbidden in URL (bug 4377) !! input http://example.com/1[2345 !! result -

http://example.com/1[2345 +

http://example.com/1[2345

!! end @@ -503,7 +594,27 @@ External links: open square bracket forbidden in URL (named) (bug 4377) !! input [http://example.com/1[2345] !! result -

[2345 +

[2345 +

+!!end + +!! test +External links: nowiki in URL link text (bug 6230) +!!input +[http://example.com/ ''example site''] +!! result +

''example site'' +

+!! end + +!! test +External links: newline forbidden in text (bug 6230 regression check) +!! input +[http://example.com/ first +second] +!! result +

[http://example.com/ first +second]

!!end @@ -530,7 +641,7 @@ Link to non-http image, no img tag !! input Link to non-http image, no img tag: ftp://example.com/test.jpg !! result -

Link to non-http image, no img tag: ftp://example.com/test.jpg +

Link to non-http image, no img tag: ftp://example.com/test.jpg

!! end @@ -539,7 +650,7 @@ External links: terminating separator !! input Terminating separator: http://example.com/thing, !! result -

Terminating separator: http://example.com/thing, +

Terminating separator: http://example.com/thing,

!! end @@ -548,7 +659,7 @@ External links: intervening separator !! input Intervening separator: http://example.com/1,2,3 !! result -

Intervening separator: http://example.com/1,2,3 +

Intervening separator: http://example.com/1,2,3

!! end @@ -557,7 +668,7 @@ External links: old bug with URL in query !! input Old bug with URL in query: [http://example.com/thing?url=http://example.com link] !! result -

Old bug with URL in query: link +

Old bug with URL in query: link

!! end @@ -566,7 +677,7 @@ External links: old URL-in-URL bug, mixed protocols !! input And again with mixed protocols: [ftp://example.com?url=http://example.com link] !! result -

And again with mixed protocols: link +

And again with mixed protocols: link

!!end @@ -575,7 +686,7 @@ External links: URL in text !! input URL in text: [http://example.com http://example.com] !! result -

URL in text: http://example.com +

URL in text: http://example.com

!! end @@ -584,7 +695,7 @@ External links: Clickable images !! input ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] !! result -

ja-style clickable images: Ncwikicol.png +

ja-style clickable images: Ncwikicol.png

!!end @@ -593,7 +704,7 @@ External links: raw ampersand !! input Old & use: http://x&y !! result -

Old & use: http://x&y +

Old & use: http://x&y

!! end @@ -602,7 +713,7 @@ External links: encoded ampersand !! input Old & use: http://x&y !! result -

Old & use: http://x&y +

Old & use: http://x&y

!! end @@ -611,7 +722,7 @@ External links: encoded equals (bug 6102) !! input http://example.com/?foo=bar !! result -

http://example.com/?foo=bar +

http://example.com/?foo=bar

!! end @@ -620,7 +731,7 @@ External links: [raw ampersand] !! input Old & use: [http://x&y] !! result -

Old & use: [1] +

Old & use: [1]

!! end @@ -629,7 +740,7 @@ External links: [encoded ampersand] !! input Old & use: [http://x&y] !! result -

Old & use: [1] +

Old & use: [1]

!! end @@ -638,7 +749,25 @@ External links: [encoded equals] (bug 6102) !! input [http://example.com/?foo=bar] !! result -

[1] +

[1] +

+!! end + +!! test +External links: [IDN ignored character reference in hostname; strip it right off] +!! input +[http://e‌xample.com/] +!! result +

[1] +

+!! end + +!! test +External links: IDN ignored character reference in hostname; strip it right off +!! input +http://e‌xample.com/ +!! result +

http://example.com/

!! end @@ -647,7 +776,7 @@ External links: www.jpeg.org (bug 554) !! input http://www.jpeg.org !!result -

http://www.jpeg.org +

http://www.jpeg.org

!! end @@ -656,7 +785,7 @@ External links: URL within URL (original bug 2) !! input [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] !! result -

[1] +

[1]

!! end @@ -665,7 +794,7 @@ BUG 361: URL inside bracketed URL !! input [http://www.example.com/foo http://www.example.com/bar] !! result -

http://www.example.com/bar +

http://www.example.com/bar

!! end @@ -674,7 +803,7 @@ BUG 361: URL within URL, not bracketed !! input http://www.example.com/foo?=http://www.example.com/bar !! result -

http://www.example.com/foo?=http://www.example.com/bar +

http://www.example.com/foo?=http://www.example.com/bar

!! end @@ -683,7 +812,7 @@ BUG 289: ">"-token in URL-tail !! input http://www.example.com/ !! result -

http://www.example.com/<hello> +

http://www.example.com/<hello>

!!end @@ -692,7 +821,7 @@ BUG 289: literal ">"-token in URL-tail !! input http://www.example.com/html !! result -

http://www.example.com/html +

http://www.example.com/html

!!end @@ -701,7 +830,7 @@ BUG 289: ">"-token in bracketed URL !! input [http://www.example.com/ stuff] !! result -

<hello> stuff +

<hello> stuff

!!end @@ -710,7 +839,7 @@ BUG 289: literal ">"-token in bracketed URL !! input [http://www.example.com/html stuff] !! result -

html stuff +

html stuff

!!end @@ -719,7 +848,7 @@ BUG 289: literal double quote at end of URL !! input http://www.example.com/"hello" !! result -

http://www.example.com/"hello" +

http://www.example.com/"hello"

!!end @@ -728,7 +857,7 @@ BUG 289: literal double quote in bracketed URL !! input [http://www.example.com/"hello" stuff] !! result -

"hello" stuff +

"hello" stuff

!!end @@ -740,7 +869,7 @@ disabled !! input [http://www.example.com test] !! result -

[http://www.example.com test] +

[http://www.example.com test]

!! end @@ -749,7 +878,7 @@ External links: multiple legal whitespace is fine, Magnus. Don't break it please !! input [http://www.example.com test] !! result -

test +

test

!! end @@ -758,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 @@ -783,11 +912,11 @@ Bug 2702: Mismatched , and tags are invalid ''Something [http://example.com mixed''''', even bold]''' '''''Now [http://example.com both'''''] !! result -

text -text -Something in italic -Something mixed, even bold -Now both +

text +text +Something in italic +Something mixed, even bold +Now both

!! end @@ -797,7 +926,7 @@ Bug 4781: %26 in URL !! input http://www.example.com/?title=AT%26T !! result -

http://www.example.com/?title=AT%26T +

http://www.example.com/?title=AT%26T

!! end @@ -806,7 +935,7 @@ Bug 4781, 5267: %26 in URL !! input http://www.example.com/?title=100%25_Bran !! result -

http://www.example.com/?title=100%25_Bran +

http://www.example.com/?title=100%25_Bran

!! end @@ -815,7 +944,7 @@ Bug 4781, 5267: %28, %29 in URL !! input http://www.example.com/?title=Ben-Hur_%281959_film%29 !! result -

http://www.example.com/?title=Ben-Hur_%281959_film%29 +

http://www.example.com/?title=Ben-Hur_%281959_film%29

!! end @@ -825,7 +954,7 @@ Bug 4781: %26 in autonumber URL !! input [http://www.example.com/?title=AT%26T] !! result -

[1] +

[1]

!! end @@ -834,7 +963,7 @@ Bug 4781, 5267: %26 in autonumber URL !! input [http://www.example.com/?title=100%25_Bran] !! result -

[1] +

[1]

!! end @@ -843,7 +972,7 @@ Bug 4781, 5267: %28, %29 in autonumber URL !! input [http://www.example.com/?title=Ben-Hur_%281959_film%29] !! result -

[1] +

[1]

!! end @@ -853,7 +982,7 @@ Bug 4781: %26 in bracketed URL !! input [http://www.example.com/?title=AT%26T link] !! result -

link +

link

!! end @@ -862,7 +991,7 @@ Bug 4781, 5267: %26 in bracketed URL !! input [http://www.example.com/?title=100%25_Bran link] !! result -

link +

link

!! end @@ -871,7 +1000,7 @@ Bug 4781, 5267: %28, %29 in bracketed URL !! input [http://www.example.com/?title=Ben-Hur_%281959_film%29 link] !! result -

link +

link

!! end @@ -880,7 +1009,7 @@ External link containing double-single-quotes in text '' (bug 4598 sanity check) !! input Some [http://example.com/ pretty ''italics'' and stuff]! !! result -

Some pretty italics and stuff! +

Some pretty italics and stuff!

!! end @@ -889,11 +1018,27 @@ External link containing double-single-quotes in text embedded in italics (bug 4 !! input ''Some [http://example.com/ pretty ''italics'' and stuff]!'' !! result -

Some pretty italics and stuff! +

Some pretty italics and stuff!

!! 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 @@ -1119,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 -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
@@ -1171,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 @@ -1187,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 @@ -1225,7 +1399,7 @@ Link to namespaces !! input [[Talk:Parser testing]], [[Meta:Disclaimers]] !! result -

Talk:Parser testing, Meta:Disclaimers +

Talk:Parser testing, Meta:Disclaimers

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

The disclaimers +

The disclaimers

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

7% Solution +

7% Solution

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

7% Solution +

7% Solution

!!end @@ -1307,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 @@ -1316,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 @@ -1336,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 @@ -1380,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 @@ -1398,7 +1600,7 @@ Inline interwiki link !! input [[MeatBall:SoftSecurity]] !! result -

MeatBall:SoftSecurity +

MeatBall:SoftSecurity

!! end @@ -1407,7 +1609,7 @@ Inline interwiki link with empty title (bug 2372) !! input [[MeatBall:]] !! result -

MeatBall: +

MeatBall:

!! end @@ -1417,8 +1619,8 @@ Interwiki link encoding conversion (bug 1636) *[[Wikipedia:ro:Olteniţa]] *[[Wikipedia:ro:Olteniţa]] !! result -
  • Wikipedia:ro:Olteniţa -
  • Wikipedia:ro:Olteniţa + !! end @@ -1428,10 +1630,57 @@ Interwiki link with fragment (bug 2130) !! input [[MeatBall:SoftSecurity#foo]] !! result -

    MeatBall:SoftSecurity#foo +

    MeatBall:SoftSecurity#foo +

    +!! 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 ### @@ -1722,7 +1971,7 @@ Magic Word: {{NUMBEROFARTICLES}} !! input {{NUMBEROFARTICLES}} !! result -

    1 +

    2

    !! end @@ -1781,7 +2030,7 @@ Magic Word: {{SERVER}} !! input {{SERVER}} !! result -

    http://localhost +

    http://localhost

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

    RFC 123 +

    RFC 123

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

    RFC 822 +

    RFC 822

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

    ISBN 0-306-40615-2 +

    ISBN 0-306-40615-2

    !! end @@ -1891,7 +2140,7 @@ Magic links: PMID incorrectly converts space to underscore !! input PMID 1234 !! result -

    PMID 1234 +

    PMID 1234

    !! end @@ -1904,7 +2153,7 @@ Nonexistant template !! input {{thistemplatedoesnotexist}} !! result -

    Template:Thistemplatedoesnotexist +

    Template:Thistemplatedoesnotexist

    !! end @@ -2081,12 +2330,12 @@ Template with complex template as argument !! end !! test -Template with thumb image (wiht link in description) +Template with thumb image (with link in description) !! input {{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 @@ -2195,7 +2444,7 @@ Template infinite loop !! input {{loop1}} !! result -

    {{loop1}} +

    Template loop detected: Template:Loop1

    !! end @@ -2360,6 +2609,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 ### @@ -2533,143 +2840,343 @@ pst !!end - -### -### Message transform tests -### !! test -message transform: magic variables +pre-save transform: in subst (bug 3298) !! options -msg +pst !! input -{{SITENAME}} +{{subst:Includes}} !! result -MediaWiki +Foobar !! end !! test -message transform: should not transform wiki markup +pre-save transform: in subst (bug 3298) !! options -msg +pst !! input -''test'' +{{subst:Includes2}} !! result -''test'' +Foo !! end -### -### Images -### !! test -Simple image +pre-save transform: context links ("pipe trick") +!! options +pst !! input -[[Image:foobar.jpg]] -!! result -

    Image:foobar.jpg -

    -!! end - -!! test -Right-aligned image +[[Article (context)|]] +[[Bar:Article|]] +[[:Bar:Article|]] +[[Bar:Article (context)|]] +[[:Bar:Article (context)|]] +[[|Article]] +[[|Article (context)]] +[[Bar:X (Y) Z|]] +[[:Bar:X (Y) Z|]] +!! result +[[Article (context)|Article]] +[[Bar:Article|Article]] +[[:Bar:Article|Article]] +[[Bar:Article (context)|Article]] +[[:Bar:Article (context)|Article]] +[[Article]] +[[Article (context)]] +[[Bar:X (Y) Z|X (Y) Z]] +[[:Bar:X (Y) Z|X (Y) Z]] +!! end + +!! test +pre-save transform: context links ("pipe trick") with interwiki prefix +!! options +pst !! input -[[Image:foobar.jpg|right]] +[[interwiki:Article|]] +[[:interwiki:Article|]] +[[interwiki:Bar:Article|]] +[[:interwiki:Bar:Article|]] !! result -
    - +[[interwiki:Article|Article]] +[[:interwiki:Article|Article]] +[[interwiki:Bar:Article|Bar:Article]] +[[:interwiki:Bar:Article|Bar:Article]] !! end !! test -Image with caption +pre-save transform: context links ("pipe trick") with parens in title +!! options +pst title=[[Somearticle (context)]] !! input -[[Image:foobar.jpg|right|Caption text]] +[[|Article]] !! result -
    Caption text
    - +[[Article (context)|Article]] !! end !! test -Image with frame and link +pre-save transform: context links ("pipe trick") with comma in title +!! options +pst title=[[Someplace, Somewhere]] !! input -[[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] +[[|Otherplace]] +[[Otherplace, Elsewhere|]] +[[Otherplace, Elsewhere, Anywhere|]] !! result -
    This is a test image Main Page
    This is a test image Main Page
    - +[[Otherplace, Somewhere|Otherplace]] +[[Otherplace, Elsewhere|Otherplace]] +[[Otherplace, Elsewhere, Anywhere|Otherplace]] !! end !! test -Link to image page- image page normally doesn't exists, hence edit link -TODO: Add test with existing image page -#

    Image:test +pre-save transform: context links ("pipe trick") with parens and comma +!! options +pst title=[[Someplace (IGNORED), Somewhere]] !! input -[[:Image:test]] +[[|Otherplace]] +[[Otherplace (place), Elsewhere|]] !! result -

    Image:test -

    +[[Otherplace, Somewhere|Otherplace]] +[[Otherplace (place), Elsewhere|Otherplace]] !! end !! test -Frameless image caption with a free URL +pre-save transform: context links ("pipe trick") with comma and parens +!! options +pst title=[[Who, me? (context)]] !! input -[[Image:foobar.jpg|http://example.com]] +[[|Yes, you.]] +[[Me, Myself, and I (1937 song)|]] !! result -

    http://example.com -

    +[[Yes, you. (context)|Yes, you.]] +[[Me, Myself, and I (1937 song)|Me, Myself, and I]] !! end !! test -Thumbnail image caption with a free URL +pre-save transform: context links ("pipe trick") with namespace +!! options +pst title=[[Ns:Somearticle]] !! input -[[Image:foobar.jpg|thumb|http://example.com]] +[[|Article]] !! result - - +[[Ns:Article|Article]] !! end !! test -BUG 1887: A ISBN with a thumbnail +pre-save transform: context links ("pipe trick") with namespace and parens +!! options +pst title=[[Ns:Somearticle (context)]] !! input -[[Image:foobar.jpg|thumb|ISBN 12354]] +[[|Article]] !! result - - +[[Ns:Article (context)|Article]] !! end !! test -BUG 1887: A RFC with a thumbnail +pre-save transform: context links ("pipe trick") with namespace and comma +!! options +pst title=[[Ns:Somearticle, Context, Whatever]] !! input -[[Image:foobar.jpg|thumb|This is RFC 12354]] +[[|Article]] !! result -
    This is RFC 12354
    Enlarge
    This is RFC 12354
    - +[[Ns:Article, Context, Whatever|Article]] !! end !! test -BUG 1887: A mailto link with a thumbnail +pre-save transform: context links ("pipe trick") with namespace, comma and parens +!! options +pst title=[[Ns:Somearticle, Context (context)]] !! input -[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] +[[|Article]] !! result - - +[[Ns:Article (context)|Article]] !! end !! test -BUG 1887: A with a thumbnail- we don't render math in the parsertests by default, -so math is not stripped and turns up as escaped <math> tags. +pre-save transform: context links ("pipe trick") with namespace, parens and comma +!! options +pst title=[[Ns:Somearticle (IGNORED), Context]] !! input -[[Image:foobar.jpg|thumb|2+2]] +[[|Article]] !! result -
    <math>2+2</math>
    Enlarge
    <math>2+2</math>
    - +[[Ns:Article, Context|Article]] !! end -!! test + +### +### Message transform tests +### +!! test +message transform: magic variables +!! options +msg +!! input +{{SITENAME}} +!! result +MediaWiki +!! end + +!! test +message transform: should not transform wiki markup +!! options +msg +!! input +''test'' +!! result +''test'' +!! end + +!! test +message transform: in transcluded template (bug 4926) +!! options +msg +!! input +{{Includes}} +!! result +Foobar +!! end + +!! test +message transform: in transcluded template (bug 4926) +!! options +msg +!! input +{{Includes2}} +!! result +Foo +!! end + +!! test +{{#special:}} page name, known +!! options +msg +!! input +{{#special:Recentchanges}} +!! result +Special:RecentChanges +!! end + +!! test +{{#special:}} page name, unknown +!! options +msg +!! input +{{#special:foobarnonexistent}} +!! result +No such special page +!! end + +### +### Images +### +!! test +Simple image +!! input +[[Image:foobar.jpg]] +!! result +

    Image:foobar.jpg +

    +!! end + +!! test +Right-aligned image +!! input +[[Image:foobar.jpg|right]] +!! result +
    + +!! end + +!! test +Image with caption +!! input +[[Image:foobar.jpg|right|Caption text]] +!! result +
    Caption text
    + +!! 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
    + +!! end + +!! test +Link to image page- image page normally doesn't exists, hence edit link +Add test with existing image page +#

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

    Image:test +

    +!! end + +!! test +Frameless image caption with a free URL +!! input +[[Image:foobar.jpg|http://example.com]] +!! result +

    http://example.com +

    +!! end + +!! test +Thumbnail image caption with a free URL +!! input +[[Image:foobar.jpg|thumb|http://example.com]] +!! result + + +!! end + +!! test +BUG 1887: A ISBN with a thumbnail +!! input +[[Image:foobar.jpg|thumb|ISBN 1235467890]] +!! result + + +!! end + +!! test +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
    + +!! end + +!! test +BUG 1887: A mailto link with a thumbnail +!! input +[[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] +!! result + + +!! end + +!! test +BUG 1887: A with a thumbnail- we don't render math in the parsertests by default, +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>
    + +!! end + +!! test BUG 1887, part 2: A with a thumbnail- math enabled !! options math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
    2 + 2
    Enlarge
    2 + 2
    +
    2 + 2
    2 + 2
    !! end @@ -2679,7 +3186,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 @@ -2688,7 +3195,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 @@ -2697,7 +3204,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 @@ -2706,7 +3213,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 @@ -2715,7 +3222,7 @@ Escape HTML special chars in image alt text !! input [[Image:foobar.jpg|& < > "]] !! result -

    & < > " +

    & < > "

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

    ♀ +

    ♀

    !! end @@ -2742,7 +3249,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!
    Enlarge
    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 Image:Icon.png inside it!
    !! end @@ -2752,7 +3259,7 @@ Image caption containing a newline [[Image:Foobar.jpg|This *is some text]] !! result -

    This *is some text +

    This *is some text

    !!end @@ -2762,7 +3269,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.
    Enlarge
    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 @@ -2803,7 +3310,7 @@ Disabled subpages !! input [[/subpage]] !! result -

    /subpage +

    /subpage

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

    Page/Subpage +

    Page/Subpage

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

    Category:MediaWiki User's Guide +

    Category:MediaWiki User's Guide

    !! end @@ -2843,7 +3350,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 ### @@ -2866,8 +3382,6 @@ es:Alimento fr:Nourriture zh:食品 ### !! test Basic section headings -!! options -title=[[Parser test script]] !! input == Headline 1 == Some text @@ -2877,21 +3391,19 @@ More ===Smaller headline=== Blah blah !! result -

    Headline 1

    +

    [edit] Headline 1

    Some text

    -

    Headline 2

    +

    [edit] Headline 2

    More

    -

    Smaller headline

    +

    [edit] Smaller headline

    Blah blah

    !! end !! test Section headings with TOC -!! options -title=[[Parser test script]] !! input == Headline 1 == === Subheadline 1 === @@ -2904,34 +3416,34 @@ Some text !! result

    Contents

    -

    Headline 1

    -

    Subheadline 1

    -
    Skipping a level
    -
    Skipping a level
    -

    Headline 2

    +

    [edit] Headline 1

    +

    [edit] Subheadline 1

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

    [edit] Headline 2

    Some text

    -

    Another headline

    +

    [edit] Another headline

    !! end @@ -2952,21 +3464,21 @@ Handling of sections up to level 6 and beyond !! result

    Contents

    -

    Level 1 Heading

    -

    Level 2 Heading

    -

    Level 3 Heading

    -

    Level 4 Heading

    -
    Level 5 Heading
    -
    Level 6 Heading
    -
    = Level 7 Heading=
    -
    == Level 8 Heading==
    -
    === Level 9 Heading===
    -
    ==== 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 +== title 1 == +=== title 1.1 === +==== title 1.1.1 ==== +=== title 1.2 === +== title 2 == +=== title 2.1 === +!! result +

    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 +TOC with wgMaxTocLevel=3 (bug 6204) !! options -title=[[Parser test script]] +wgMaxTocLevel=3 +!! input +== title 1 == +=== title 1.1 === +==== title 1.1.1 ==== +=== title 1.2 === +== title 2 == +=== title 2.1 === +!! result +

    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 -

    Foo bar

    -

    Foo bar

    +

    [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 @@ -3014,18 +3609,16 @@ Template:sections !! test Template with sections, __NOTOC__ -!! options -title=[[Parser test script]] !! input __NOTOC__ ==Section 0== {{sections}} ==Section 4== !! result -

    Section 0

    -

    Section 1

    -

    Section 2

    -

    Section 4

    +

    [edit] Section 0

    +

    [edit] Section 1

    +

    [edit] Section 2

    +

    [edit] Section 4

    !! end @@ -3036,29 +3629,50 @@ __NOEDITSECTION__ ==Section 1== ==Section 2== !! result -

    Section 1

    -

    Section 2

    +

    Section 1

    +

    Section 2

    !! end !! test Link inside a section heading -!! options -title=[[Parser test script]] !! input ==Section with a [[Main Page|link]] in it== !! result -

    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 @@ -3067,7 +3681,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 @@ -3076,7 +3690,7 @@ Bug 1186 news: in the middle of text !! input http://en.wikinews.org/wiki/Wikinews:Workplace !! result -

    http://en.wikinews.org/wiki/Wikinews:Workplace +

    http://en.wikinews.org/wiki/Wikinews:Workplace

    !!end @@ -3215,7 +3829,7 @@ Media link !! input [[Media:Foobar.jpg]] !! result -

    Media:Foobar.jpg +

    Media:Foobar.jpg

    !! end @@ -3224,7 +3838,7 @@ Media link with text !! input [[Media:Foobar.jpg|A neat file to look at]] !! result -

    A neat file to look at +

    A neat file to look at

    !! end @@ -3235,7 +3849,7 @@ fixme: doBlockLevels won't wrap this in a paragraph because it contains a div !! input [[Media:Foobar.jpg|Safe Link
    " onmouseover="alert(document.cookie)" onfoo="
    ]] !! result -Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> +Safe Link<div style="display:none">" onmouseover="alert(document.cookie)" onfoo="</div> !! end @@ -3244,7 +3858,7 @@ Media link to nonexistent file (bug 1702) !! input [[Media:No such.jpg]] !! result -

    Media:No such.jpg +

    Media:No such.jpg

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

    Image:No such.jpg +

    Image:No such.jpg

    !! end @@ -3431,7 +4045,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) !! input {{div style|">}} !! result -
    Magic div
    +
    <script>alert(document.cookie)</script>">Magic div
    !! end @@ -3440,7 +4054,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 @@ -3467,7 +4081,7 @@ Bug 2304: HTML attribute safety (bold) !! input
    !! result -
    +
    !! end @@ -3569,7 +4183,7 @@ MSIE CSS safety test: comment in url !! input
    evil
    !! result -
    evil
    +
    evil
    !! end @@ -3578,7 +4192,7 @@ MSIE CSS safety test: comment in expression !! input
    evil4
    !! result -
    evil4
    +
    evil4
    !! end @@ -3611,6 +4225,42 @@ Table attribute safety !! end + +!! article +Template:Identity +!! text +{{{1}}} +!! endarticle + +!! test +Expansion of multi-line templates in attribute values (bug 6255) +!! input +
    -
    +!! result +
    -
    + +!! end + + +!! test +Expansion of multi-line templates in attribute values (bug 6255 sanity check) +!! input +
    -
    +!! result +
    -
    + +!! end + +!! test +Expansion of multi-line templates in attribute values (bug 6255 sanity check 2) +!! input +
    -
    +!! result +
    -
    + +!! end + ### ### Parser hooks (see maintenance/parserTestsParserHook.php for the extension) ### @@ -3668,7 +4318,7 @@ array(0) { !! test -Parser hook: case insensetive +Parser hook: case insensitive !! input input !! result @@ -3682,7 +4332,7 @@ array(0) { !! test -Parser hook: case insensetive, redux +Parser hook: case insensitive, redux !! input input !! result @@ -3894,6 +4544,16 @@ disabled Something, but defenetly not
    ... !! end +!! test +Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301) +!! options +disabled +!! input +

    +!! result +Something need to be done. foo-2 ? +!! end + !! test Language converter: output gets cut off unexpectedly (bug 5757) !! options @@ -3921,7 +4581,7 @@ Self closed html pairs (bug 5487)
    Centered text
    In div text
    !! result -
    <font id="bug" />Centered text
    +
    <font id="bug" />Centered text
    <font id="bug2" />In div text
    !! end @@ -3931,18 +4591,46 @@ Self closed html pairs (bug 5487) # !! test -HTML bullet list, closed tags (bug 5497) +Punctuation: nbsp before exclamation !! input -
      -
    • One
    • -
    • Two
    • -
    +C'est grave ! !! result -
      -
    • One
    • -
    • Two
    • -
    - +

    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 +
      +
    • One
    • +
    • Two
    • +
    +!! result +
      +
    • One
    • +
    • Two
    • +
    + !! end !! test @@ -4108,11 +4796,11 @@ ftp://inlineftp mailto:inline@mail.tld !! result -

    [1] [2] [3] -

    ftp://inlineftp -

    With target -

    [4] -

    mailto:inline@mail.tld +

    [1] [2] [3] +

    ftp://inlineftp +

    With target +

    [4] +

    mailto:inline@mail.tld

    !! end @@ -4143,10 +4831,10 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! result -

    onmouseover=

    +

    [edit] onmouseover=

    http://

    Contents

    @@ -4158,7 +4846,7 @@ Fuzz testing: Parser14-table ==a== {| STYLE=__TOC__ !! result -

    a

    +

    [edit] a

    @@ -4192,7 +4880,7 @@ Fuzz testing: Parser21 !! result - @@ -4207,7 +4895,7 @@ http://===r:::https://b {| !!result -

    http://===r:::https://b +

    http://===r:::https://b

    irc://{{ftp://a" onmouseover="alert('hello world');" + irc://{{ftp://a" onmouseover="alert('hello world');"
    @@ -4231,9 +4919,9 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT | !! result
    - -} > -
    +{{{| +}}}} > +
    MOVE YOUR MOUSE CURSOR OVER THIS TEXT
    @@ -4244,11 +4932,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 {{{ | @@ -4256,9 +4949,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 @@ -4267,7 +4959,7 @@ Fuzz testing: URL adjacent extension (with space, clean) !! input http://example.com junk !! result -

    http://example.com junk +

    http://example.com junk

    !!end @@ -4277,7 +4969,7 @@ Fuzz testing: URL adjacent extension (no space, dirty; nowiki) !! input http://example.comjunk !! result -

    http://example.comjunk +

    http://example.comjunk

    !!end @@ -4287,7 +4979,7 @@ Fuzz testing: URL adjacent extension (no space, dirty; pre) !! input http://example.com
    junk
    !! result -http://example.com
    junk
    +http://example.com
    junk
    !!end @@ -4296,10 +4988,19 @@ Fuzz testing: image with bogus manual thumbnail !!input [[Image:foobar.jpg|thumbnail= ]] !!result -
    Enlarge
    +
    Error creating thumbnail:
    !!end +!! test +Fuzz testing: encoded newline in generated HTML replacements (bug 6577) +!! input +
    
    +!! result
    +
    
    +
    +!! end
    +
     !! test
     Parsing optional HTML elements (Bug 6171)
     !! options
    @@ -4378,14 +5079,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 Mixing markup for italics and bold !! options !! input '''bold''''''bold''bolditalics''''' !! result -

    boldboldbolditalics +

    'bold'boldbolditalics

    !! end @@ -4424,6 +5130,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 @@ -4713,8 +5455,8 @@ Section extraction test with comment after heading (section 1) section=1 !! input ==a== -==legal== -==b== +==b== +==c== !! result ==a== !! end @@ -4725,10 +5467,10 @@ Section extraction test with comment after heading (section 2) section=2 !! input ==a== -==legal== -==b== +==b== +==c== !! result -==legal== +==b== !! end !! test @@ -4757,88 +5499,1596 @@ 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) +Section replacement test (section 0) !! options -section=1 +replace=0,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +xxx + +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 1) +!! options +replace=1,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +xxx + +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 2) +!! options +replace=2,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +xxx + +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 3) +!! options +replace=3,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +xxx + +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 4) +!! options +replace=4,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +xxx + +==c== +===ca=== +!! end + +!! test +Section replacement test (section 5) +!! options +replace=5,"xxx" !! input -

    a

    -

    aa

    -

    b

    +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== !! result -

    a

    -

    aa

    +start +==a== +===aa=== +====aaa==== +==b== +xxx + +===bb=== +====bba==== +===bc=== +==c== +===ca=== !! end +!! test +Section replacement test (section 6) +!! options +replace=6,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +xxx + +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 7) +!! options +replace=7,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +xxx + +===bc=== +==c== +===ca=== +!! end + +!! test +Section replacement test (section 8) +!! options +replace=8,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +xxx + +==c== +===ca=== +!!end + +!! test +Section replacement test (section 9) +!! options +replace=9,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +xxx +!! end + +!! test +Section replacement test (section 10) +!! options +replace=10,"xxx" +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +xxx +!! end + +!! test +Section replacement test with initial whitespace (bug 13728) +!! options +replace=2,"xxx" +!! input + Preformatted initial line +==a== +===a=== +!! result + Preformatted initial line +==a== +xxx +!! end + + +!! test +Section extraction, heading followed by pre with 20 spaces (bug 6398) +!! options +section=1 +!! input +==a== + a +!! result +==a== + a +!! end + +!! test +Section extraction, heading followed by pre with 19 spaces (bug 6398 sanity check) +!! options +section=1 +!! input +==a== + a +!! result +==a== + a +!! end + + +!! test +Section extraction,
     around bogus header (bug 10309)
    +!! options
    +noxml section=2
    +!! input
    +== Section One ==
    +
    +=======
    +
    + +== Section Two == +stuff +!! result +== Section Two == +stuff +!! end + +!! test +Section replacement,
     around bogus header (bug 10309)
    +!! options
    +noxml replace=2,"xxx"
    +!! input
    +== Section One ==
    +
    +=======
    +
    + +== Section Two == +stuff +!! result +== Section One == +
    +=======
    +
    + +xxx +!! end + + + +!! test +Handling of in URLs +!! input +**irc:// a +!! result + + +!!end + +!! test +5 quotes, code coverage +1 line +!! input +''''' +!! result +!! end + +!! test +Special:Search page linking. +!! input +{{Special:search}} +!! result +

    Special:Search +

    +!! end + +!! test +Say the magic word +!! input +* {{PAGENAME}} +* {{BASEPAGENAME}} +* {{SUBPAGENAME}} +* {{SUBPAGENAMEE}} +* {{BASEPAGENAME}} +* {{BASEPAGENAMEE}} +* {{TALKPAGENAME}} +* {{TALKPAGENAMEE}} +* {{SUBJECTPAGENAME}} +* {{SUBJECTPAGENAMEE}} +* {{NAMESPACEE}} +* {{NAMESPACE}} +* {{TALKSPACE}} +* {{TALKSPACEE}} +* {{SUBJECTSPACE}} +* {{SUBJECTSPACEE}} +* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} +!! result +
    • Parser test +
    • Parser test +
    • Parser test +
    • Parser_test +
    • Parser test +
    • Parser_test +
    • Talk:Parser test +
    • Talk:Parser_test +
    • Parser test +
    • Parser_test +
    • +
    • +
    • Talk +
    • Talk +
    • +
    • +
    • Template:Dynamic +
    + +!! end +### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. + +!! test +Gallery +!! input + +image1.png | +image2.gif||||| + +image3| +image4 |300px| centre + image5.svg| http:///////// +[[x|xx]]]] +* image6 + +!! result +
  • + + + + + + + + + + + + +!! end + +!! test +HTML Hex character encoding (spells the word "JavaScript") +!! input +JavaScript +!! result +

    JavaScript +

    +!! end + +!! test +__FORCETOC__ override +!! input +__NEWSECTIONLINK__ +__FORCETOC__ +!! result +


    +

    +!! end + +!! test +ISBN code coverage +!! input +ISBN 978-0-1234-56 789 +!! result +

    ISBN 978-0-1234-56 789 +

    +!! end + +!! test +ISBN followed by 5 spaces +!! input +ISBN +!! result +

    ISBN +

    +!! end + +!! test +Double ISBN +!! input +ISBN ISBN 1234567890 +!! result +

    ISBN ISBN 1234567890 +

    +!! end + +!! test +Double RFC +!! input +RFC RFC 1234 +!! result +

    RFC RFC 1234 +

    +!! end + +!! test +Double RFC with a wiki link +!! input +RFC [[RFC 1234]] +!! result +

    RFC RFC 1234 +

    +!! end + +!! test +RFC code coverage +!! input +RFC 983 987 +!! result +

    RFC 983 987 +

    +!! end + +!! test +Centre-aligned image +!! input +[[Image:foobar.jpg|centre]] +!! result +
    + +!!end + +!! test +None-aligned image +!! input +[[Image:foobar.jpg|none]] +!! result +
    + +!!end + +!! test +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 + +!! test +Another italics / bold test +!! input + ''' ''x' +!! result +
    ' x'
    +
    +!!end + +# Note the results may be incorrect, as parserTest output included this: +# XML error: Mismatched tag at byte 6120: +# ...
+
+
+
+
+
+
+ +!!end + + +# Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "" tag. +!! test +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
+ +!!end + +!! test +[Before] HTML without raw HTML enabled ($wgRawHtml==false) +!! input + +!! result +

<html><script>alert(1);</script></html> +

+!! end + +!! test +HTML with raw HTML ($wgRawHtml==true) +!! options +rawhtml +!! input + +!! result +

+

+!! end + +!! test +Parents of subpages, one level up +!! options +subpage title=[[Subpage test/L1/L2/L3]] +!! input +[[../|L2]] +!! result +

L2 +

+!! end + + +!! test +Parents of subpages, one level up, not named +!! options +subpage title=[[Subpage test/L1/L2/L3]] +!! input +[[../]] +!! result +

Subpage test/L1/L2 +

+!! end + + + +!! test +Parents of subpages, two levels up +!! options +disabled +subpage title=[[Subpage test/L1/L2/L3]] +!! input +[[../../|L1]]2 +!! result +

L1 +

+!! end + +!! test +Parents of subpages, two levels up, without trailing slash or name. +!! options +subpage title=[[Subpage test/L1/L2/L3]] +!! input +[[../..]] +!! result +

[[../..]] +

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

/// +

+!! end + +!! test +Definition list code coverage +!! input +; title : def +; title : def +;title: def +!! result +
title  
def +
title 
def +
title
def +
+ +!! end + +!! test +Don't fall for the self-closing div +!! input +
hello world
+!! result +
hello world
+ +!! end + +!! test +MSGNW magic word +!! input +{{MSGNW:msg}} +!! result +

[[:Template:Msg]] +

+!! end + +!! test +RAW magic word +!! input +{{RAW:QUERTY}} +!! result +

Template:QUERTY +

+!! end + +# This isn't needed for XHTML conformance, but would be handy as a fallback security measure +!! test +Always escape literal '>' in output, not just after '<' +!! input +><> +!! result +

><> +

+!! end + +!! test +Template caching +!! input +{{Test}} +{{Test}} +!! result +

This is a test template +This is a test template +

+!! end + + +!! article +MediaWiki:Fake +!! text +==header== +!! endarticle + +!! test +Inclusion of !userCanEdit() content +!! input +{{MediaWiki:Fake}} +!! result +

[edit] header

+ +!! end + + +!! test +Out-of-order TOC heading levels +!! input +==2== +======6====== +===3=== +=1= +=====5===== +==2== +!! result +

Contents

+ +
+

[edit] 2

+
[edit] 6
+

[edit] 3

+

[edit] 1

+
[edit] 5
+

[edit] 2

+ +!! end + + +!! test +ISBN with a dummy number +!! input +ISBN --- +!! result +

ISBN --- +

+!! end + + +!! test +ISBN with space-delimited number +!! input +ISBN 92 9017 032 8 +!! result +

ISBN 92 9017 032 8 +

+!! end + + +!! test +ISBN with multiple spaces, no number +!! input +ISBN foo +!! result +

ISBN foo +

+!! end + + +!! test +ISBN length +!! input +ISBN 123456789 + +ISBN 1234567890 + +ISBN 12345678901 +!! result +

ISBN 123456789 +

ISBN 1234567890 +

ISBN 12345678901 +

+!! end + + +!! test +ISBN with trailing year (bug 8110) +!! input +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 +

+!! end + + +!! test +Pages in namespace (Magic word disabled currently) +!! input +{{PAGESINNAMESPACE:}} +!! result + +!! end + + +!! test +anchorencode +!! input +{{anchorencode:foo bar©#%n}} +!! result +

foo_bar.C2.A9.23.25n +

+!! end + + +!! test +Bug 8293: Use of center tag ruins paragraph formatting +!! input +
+foo +
+ +bar + + baz +!! result +
+

foo +

+
+

bar +

+
baz
+
+!! end + + +### +### Language variants related tests +### +!! test +Self-link in language variants +!! options +title=[[Dunav]] language=sr +!! input +Both [[Dunav]] and [[Дунав]] are names for this river. +!! result +

Both Dunav and Дунав are names for this river. +

+!!end + + +!! test +Link to pages in language variants +!! options +language=sr +!! input +Main Page can be written as [[Маин Паге]] +!! result +

Main Page can be written as Маин Паге +

+!!end + + +!! test +Multiple links to pages in language variants +!! options +language=sr +!! input +[[Main Page]] can be written as [[Маин Паге]] same as [[Маин Паге]]. +!! result +

Main Page can be written as Маин Паге same as Маин Паге. +

+!!end + + +!! test +Simple template in language variants +!! options +language=sr +!! input +{{тест}} +!! result +

This is a test template +

+!! end + + +!! test +Template with explicit namespace in language variants +!! options +language=sr +!! input +{{Template:тест}} +!! result +

This is a test template +

+!! end + + +!! test +Basic test for template parameter in language variants +!! options +language=sr +!! input +{{парамтест|param=foo}} +!! result +

This is a test template with parameter foo +

+!! end + + +!! test +Simple category in language variants +!! options +language=sr cat +!! input +[[:Category:МедиаWики Усер'с Гуиде]] +!! result +MediaWiki User's Guide +!! end + + +!! test +Stripping -{}- tags (language variants) +!! options +language=sr +!! input +Latin proverb: -{Ne nuntium necare}- +!! result +

Latin proverb: Ne nuntium necare +

+!! end + + +!! test +Prevent conversion with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +Latinski: -{Ne nuntium necare}- +!! result +

Латински: Ne nuntium necare +

+!! end + + +!! test +Prevent conversion of text with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +Latinski: -{Ne nuntium necare}- +!! result +

Латински: Ne nuntium necare +

+!! end + + +!! test +Prevent conversion of links with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +-{[[Main Page]]}- +!! result +

Main Page +

+!! end + + +!! test +-{}- tags within headlines (within html for parserConvert()) +!! options +language=sr variant=sr-ec +!! input +== -{Naslov}- == +!! result +

[уреди] Naslov

+ +!! end + + +!! test +Explicit definition of language variant alternatives +!! options +language=zh variant=zh-tw +!! input +-{zh:China;zh-tw:Taiwan}-, not China +!! result +

Taiwan, not China +

+!! end + + +!! test +Adding explicit session-wise language variant mapping (A flag) +!! options +language=zh variant=zh-tw +!! input +-{A|zh:China;zh-tw:Taiwan}- is China +!! result +

Taiwan is Taiwan +

+!! end + + +!! test +Adding explicit conversion rule for title (T flag) +!! options +language=zh variant=zh-tw +!! input +Should be stripped-{T|zh:China;zh-tw:Taiwan}-! +!! result +

Should be stripped! +

+!! end + + +!! test +Raw output of variant escape tags (R flag) +!! options +language=zh variant=zh-tw +!! input +Raw: -{R|zh:China;zh-tw:Taiwan}- +!! result +

Raw: zh:China;zh-tw:Taiwan +

+!! end + + +!! test +Do not convert roman numbers to language variants +!! options +language=sr variant=sr-ec +!! input +Fridrih IV je car. +!! result +

Фридрих IV је цар. +

+!! 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
hello
+ +!! end # # @@ -4850,3 +7100,4 @@ more tables math character entities and much more +Try for 100% code coverage