X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FparserTests.txt;h=10bdf0d658611b474362412962275acecd66299e;hb=63a6b8e0a3740660912c6052549933ac6e1cc277;hp=a9c9db2b6ff8a8c5cfc450b795a39542936dd3a0;hpb=b126d37c7fe8e71539b9aeae06b31075fad35d26;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index a9c9db2b6f..10bdf0d658 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 @@ -254,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 @@ -263,7 +283,7 @@ Comment semantics: nesting !! input --> !! result -

--> +

-->

!! end @@ -275,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 @@ -421,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 @@ -847,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 @@ -982,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=%26 +

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

/index.php?title=Some_page&q=%3F&amp=%26 +

+!! end ### ### Quotes @@ -1210,7 +1266,7 @@ Invalid attributes in table cell (bug 1830) # FIXME: this one has incorrect tag nesting still. !! 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 @@ -1260,7 +1316,7 @@ Broken link !! input [[Zigzagzogzagzig]] !! result -

Zigzagzogzagzig +

Zigzagzogzagzig

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

Talk:Parser testing, Meta:Disclaimers +

Talk:Parser testing, Meta:Disclaimers

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

The disclaimers +

The disclaimers

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

7% Solution +

7% Solution

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

7% Solution +

7% Solution

!!end @@ -1383,7 +1439,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 @@ -1396,7 +1452,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 @@ -1405,7 +1461,7 @@ 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 @@ -1469,6 +1525,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 @@ -1521,6 +1605,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 ### @@ -1811,7 +1942,7 @@ Magic Word: {{NUMBEROFARTICLES}} !! input {{NUMBEROFARTICLES}} !! result -

1 +

2

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

RFC 123 +

RFC 123

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

RFC 822 +

RFC 822

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

ISBN 0-306-40615-2 +

ISBN 0-306-40615-2

!! end @@ -1993,7 +2124,7 @@ Nonexistant template !! input {{thistemplatedoesnotexist}} !! result -

Template:Thistemplatedoesnotexist +

Template:Thistemplatedoesnotexist

!! end @@ -2175,7 +2306,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 @@ -2284,7 +2415,7 @@ Template infinite loop !! input {{loop1}} !! result -

loop1 +

Template loop detected: Template:Loop1

!! end @@ -2449,6 +2580,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 ### @@ -2807,7 +2996,7 @@ msg !! end !! test -TODO: message transform: in transcluded template (bug 4926) +message transform: in transcluded template (bug 4926) !! options msg !! input @@ -2817,7 +3006,7 @@ Foobar !! end !! test -TODO: message transform: in transcluded template (bug 4926) +message transform: in transcluded template (bug 4926) !! options msg !! input @@ -2833,7 +3022,7 @@ msg !! input {{#special:Recentchanges}} !! result -Special:Recentchanges +Special:RecentChanges !! end !! test @@ -2854,7 +3043,7 @@ Simple image !! input [[Image:foobar.jpg]] !! result -

Image:foobar.jpg +

Image:foobar.jpg

!! end @@ -2863,7 +3052,7 @@ Right-aligned image !! input [[Image:foobar.jpg|right]] !! result -
+
!! end @@ -2872,7 +3061,7 @@ Image with caption !! input [[Image:foobar.jpg|right|Caption text]] !! result -
Caption text
+
Caption text
!! end @@ -2881,13 +3070,13 @@ 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
This is a test image Main Page
!! end !! test Link to image page- image page normally doesn't exists, hence edit link -TODO: Add test with existing image page +Add test with existing image page #

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

http://example.com +

http://example.com

!! end @@ -2910,16 +3099,16 @@ 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 12354]] +[[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result - + !! end @@ -2928,7 +3117,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
Enlarge
This is RFC 12354
+
This is RFC 12354
This is RFC 12354
!! end @@ -2937,7 +3126,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result - + !! end @@ -2947,7 +3136,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>
Enlarge
<math>2+2</math>
+
<math>2+2</math>
<math>2+2</math>
!! end @@ -2958,7 +3147,7 @@ math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
2 + 2
Enlarge
2 + 2
+
2 + 2
2 + 2
!! end @@ -2968,7 +3157,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 @@ -2977,7 +3166,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 @@ -2986,7 +3175,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 @@ -2995,7 +3184,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 @@ -3004,7 +3193,7 @@ Escape HTML special chars in image alt text !! input [[Image:foobar.jpg|& < > "]] !! result -

& < > " +

& < > "

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

♀ +

♀

!! end @@ -3031,7 +3220,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 @@ -3041,7 +3230,7 @@ Image caption containing a newline [[Image:Foobar.jpg|This *is some text]] !! result -

This *is some text +

This *is some text

!!end @@ -3051,7 +3240,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 @@ -3092,7 +3281,7 @@ Disabled subpages !! input [[/subpage]] !! result -

/subpage +

/subpage

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

Page/Subpage +

Page/Subpage

!! end @@ -3135,6 +3324,15 @@ cat MediaWiki User's Guide !! end +!! test +PAGESINCATEGORY invalid title fatal (r33546 fix) +!! input +{{PAGESINCATEGORY:}} +!! result +

0 +

+!! end + ### ### Inter-language links ### @@ -3277,6 +3475,80 @@ Handling of sections up to level 6 and beyond !! end +!! test +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 +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 @@ -3288,6 +3560,17 @@ Resolving duplicate section names !! 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 @@ -3304,8 +3587,8 @@ __NOTOC__ ==Section 4== !! result

[edit] Section 0

-

[edit] Section 1

-

[edit] Section 2

+

[edit] Section 1

+

[edit] Section 2

[edit] Section 4

!! end @@ -3331,13 +3614,36 @@ Link inside a section heading !! 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 @@ -3346,7 +3652,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 @@ -3541,7 +3847,7 @@ Image link to nonexistent file (bug 1850 - good) !! input [[:Image:No such.jpg]] !! result -

Image:No such.jpg +

Image:No such.jpg

!! end @@ -3710,7 +4016,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309) !! input {{div style|">}} !! result -
Magic div
+
<script>alert(document.cookie)</script>">Magic div
!! end @@ -3719,7 +4025,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 @@ -3746,7 +4052,7 @@ Bug 2304: HTML attribute safety (bold) !! input
!! result -
+
!! end @@ -3848,7 +4154,7 @@ MSIE CSS safety test: comment in url !! input
evil
!! result -
evil
+
evil
!! end @@ -3857,7 +4163,7 @@ MSIE CSS safety test: comment in expression !! input
evil4
!! result -
evil4
+
evil4
!! end @@ -3983,7 +4289,7 @@ array(0) { !! test -Parser hook: case insensetive +Parser hook: case insensitive !! input input !! result @@ -3997,7 +4303,7 @@ array(0) { !! test -Parser hook: case insensetive, redux +Parser hook: case insensitive, redux !! input input !! result @@ -4255,6 +4561,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 @@ -4271,7 +4605,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 @@ -4301,7 +4635,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 @@ -4341,7 +4675,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 @@ -4389,7 +4723,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 @@ -4556,9 +4890,9 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT | !! result - -} > -
          +{{{| +}}}} > +
          MOVE YOUR MOUSE CURSOR OVER THIS TEXT
          @@ -4581,8 +4915,10 @@ noxml > }}}blah" onmouseover="alert('hello world');" align="left"'''MOVE MOUSE CURSOR OVER HERE !! result +

          {{{| +

        2. -blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE +}}}blah" onmouseover="alert('hello world');" align="left"MOVE MOUSE CURSOR OVER HERE !! end @@ -4621,7 +4957,7 @@ Fuzz testing: image with bogus manual thumbnail !!input [[Image:foobar.jpg|thumbnail= ]] !!result -
          Enlarge
          +
          Error creating thumbnail:
          !!end @@ -4635,7 +4971,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
        3. @@ -4701,7 +5037,7 @@ New wiki paragraph !! end !! test -TODO: Inline HTML vs wiki block nesting +Inline HTML vs wiki block nesting !! input Bold paragraph @@ -4714,7 +5050,7 @@ New wiki paragraph !!test -TODO: Mixing markup for italics and bold +Mixing markup for italics and bold !! options !! input '''bold''''''bold''bolditalics''''' @@ -4758,6 +5094,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 @@ -5047,8 +5419,8 @@ Section extraction test with comment after heading (section 1) section=1 !! input ==a== -==legal== -==b== +==b== +==c== !! result ==a== !! end @@ -5059,10 +5431,10 @@ Section extraction test with comment after heading (section 2) section=2 !! input ==a== -==legal== -==b== +==b== +==c== !! result -==legal== +==b== !! end !! test @@ -5091,102 +5463,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 @@ -5517,119 +5866,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 @@ -5642,7 +5958,7 @@ Handling of in URLs !!end !! test -TODO: 5 quotes, code coverage +1 line +5 quotes, code coverage +1 line !! input ''''' !! result @@ -5694,7 +6010,7 @@ Say the magic word
        4. Talk
        5. -
        6. Template:Dynamic +
        7. Template:Dynamic
        8. !! end @@ -5714,19 +6030,47 @@ image4 |300px| centre * image6 !! result -
          - - - - - - + + + + + + + + + + + !! end @@ -5753,9 +6097,9 @@ __FORCETOC__ !! test ISBN code coverage !! input -ISBN 983 987 +ISBN 978-0-1234-56 789 !! result -

          ISBN 983 987 +

          ISBN 978-0-1234-56 789

          !! end @@ -5770,12 +6114,10 @@ ISBN !! test Double ISBN -!! options -disabled # Disabled until Bug 6560 resolved !! input -ISBN ISBN 1234 +ISBN ISBN 1234567890 !! result -

          ISBN ISBN 1234 +

          ISBN ISBN 1234567890

          !! end @@ -5784,7 +6126,7 @@ Double RFC !! input RFC RFC 1234 !! result -

          RFC RFC 1234 +

          RFC RFC 1234

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

          RFC RFC 1234 +

          RFC RFC 1234

          !! end @@ -5802,7 +6144,7 @@ RFC code coverage !! input RFC 983 987 !! result -

          RFC 983 987 +

          RFC 983 987

          !! end @@ -5811,7 +6153,7 @@ Centre-aligned image !! input [[Image:foobar.jpg|centre]] !! result -
          +
          !!end @@ -5820,7 +6162,7 @@ None-aligned image !! input [[Image:foobar.jpg|none]] !! result -
          +
          !!end @@ -5829,7 +6171,7 @@ Width + Height sized image (using px) (height is ignored) !! input [[Image:foobar.jpg|640x480px]] !! result -

          +

          !!end @@ -5846,16 +6188,16 @@ Another italics / bold test # XML error: Mismatched tag at byte 6120: # ...
-
-
- + + + !!end @@ -5863,11 +6205,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
Enlarge
An external URL
+
An external URL
An external URL
!!end @@ -5898,7 +6240,7 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../|L2]] !! result -

L2 +

L2

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

Subpage test/L1/L2 +

Subpage test/L1/L2

!! end @@ -5924,33 +6266,33 @@ 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 +

Subpage test/L1

!! end @@ -5969,7 +6311,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 @@ -5982,7 +6324,7 @@ MSGNW magic word !! input {{MSGNW:msg}} !! result -

[[:Template:Msg]] +

[[:Template:Msg]]

!! end @@ -5991,13 +6333,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 @@ -6028,7 +6370,7 @@ Inclusion of !userCanEdit() content !! input {{MediaWiki:Fake}} !! result -

[edit] header

+

[edit] header

!! end @@ -6084,7 +6426,7 @@ ISBN with space-delimited number !! input ISBN 92 9017 032 8 !! result -

ISBN 92 9017 032 8 +

ISBN 92 9017 032 8

!! end @@ -6099,6 +6441,35 @@ 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 @@ -6108,6 +6479,16 @@ Pages in namespace (Magic word disabled currently) !! 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 @@ -6130,6 +6511,324 @@ bar !! 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 + # # #