From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- tests/parser/parserTests.txt | 9493 +++++++++++++++++++++++++++++++----------- 1 file changed, 7043 insertions(+), 2450 deletions(-) (limited to 'tests/parser/parserTests.txt') diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f0603e75..02a66b51 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -26,6 +26,11 @@ # showtitle make the first line the title # comment run through Linker::formatComment() instead of main parser # local format section links in edit comment text as local links +# notoc disable table of contents +# +# You can also set the following parser properties via test options: +# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel, +# wgLinkHolderBatchSize, wgRawHtml # # For testing purposes, temporary articles can created: # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle @@ -116,12 +121,31 @@ Template:table_attribs |style="color: red"| Foo !! endarticle +!! article +Template:table_cells +!! text +{{table_attribs}} || Bar || Baz +!! endarticle + +!! article +Template:image_attribs +!! text + +[[File:foobar.jpg|right|Caption text]] +!! endarticle + !! article A?b !! text Weirdo titles! !! endarticle +!!article +Template:Bullet +!!text +* Bar +!!endarticle + ### ### Basic tests ### @@ -164,6 +188,206 @@ baz

!! end +!! test +Paragraphs with newline spacing with comment lines in between +!! input +---- +a + +b +---- +a + +b +---- +a + +b +---- +a + + +b +---- +a + + +b +---- +a + + + +b +---- +a + + + +b +---- +!! result +
+

a +b +

+
+

a +b +

+
+

a +b +

+
+

a +

b +

+
+

a +

b +

+
+

a +


+b +

+
+

a +


+b +

+
+ +!! end + +!! test +Paragraphs with newline spacing with non-empty white-space lines in between +!! input +---- +a + +b +---- +a + + +b +---- +!! result +
+

a +

b +

+
+

a +


+b +

+
+ +!! end + +!! test +Paragraphs with newline spacing with non-empty mixed comment and white-space lines in between +!! input +---- +a + +b +---- +a + +b +---- +a + + + +b +---- +a + + + + +b +---- +!! result +
+

a +b +

+
+

a +b +

+
+

a +

b +

+
+

a +


+b +

+
+ +!! end + +!! test +Extra newlines: More paragraphs with indented comment +!! input +a + + + +b +!!result +

a +


+b +

+!!end + +!! test +Extra newlines followed by heading +!! input +a + + + +=b= +[[a]] + + +=b= +!! result +

a +


+

+

b[edit]

+

a +


+

+

b[edit]

+ +!! end + +!! test +Extra newlines between heading and content are swallowed +!! input +=b= + + + +[[a]] +!! result +

b[edit]

+

a +

+!! end + !! test Parsing an URL !! input @@ -180,9 +404,12 @@ Simple list * Item 1 * Item 2 !! result - + !! end @@ -205,25 +432,72 @@ Italics and bold * plain l'''italic''plain * plain l''''bold''' plain !! result - + + +!! end + +# this example taken from the [[simple:Moon]] article (bug 47326) +!! test +Italics and possessives (1) +!! input +obtained by ''[[Lunar Prospector]]'''s gamma-ray spectrometer +!! result +

obtained by Lunar Prospector's gamma-ray spectrometer +

+!! end + +# this example taken from [[en:Flaming Pie]] (bug 49926) +!! test +Italics and possessives (2) +!! input +'''''Flaming Pie''''' is ... released in 1997. In ''Flaming Pie'''s liner notes +!! result +

Flaming Pie is ... released in 1997. In Flaming Pie's liner notes +

+!! end +# this example taken from [[en:Dictionary]] (bug 49926) +!! test +Italics and possessives (3) +!! input +The first monolingual dictionary written in a Romance language was ''Sebastián Covarrubias''' ''Tesoro de la lengua castellana o española'', published in 1611 in Madrid. In 1612 the first edition of the ''Vocabolario dell'[[Accademia della Crusca]]'', for Italian, was published. In 1690 in Rotterdam was published, posthumously, the ''Dictionnaire Universel''. +!! result +

The first monolingual dictionary written in a Romance language was Sebastián Covarrubias' Tesoro de la lengua castellana o española, published in 1611 in Madrid. In 1612 the first edition of the Vocabolario dell'Accademia della Crusca, for Italian, was published. In 1690 in Rotterdam was published, posthumously, the Dictionnaire Universel. +

!! end + ### ### 2-quote opening sequence tests ### @@ -258,13 +532,26 @@ Italics and bold: 2-quote opening sequence: (2,4) !! test -Italics and bold: 2-quote opening sequence: (2,5) +Italics and bold: 2-quote opening sequence: (2,5) (php) +!! options +php !! input ''foo''''' !! result

foo

!!end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +Italics and bold: 2-quote opening sequence: (2,5) (parsoid) +!! options +parsoid +!! input +''foo''''' +!! result +

foo +

+!!end ### @@ -302,13 +589,26 @@ Italics and bold: 3-quote opening sequence: (3,4) !! test -Italics and bold: 3-quote opening sequence: (3,5) +Italics and bold: 3-quote opening sequence: (3,5) (php) +!! options +php !! input '''foo''''' !! result

foo

!!end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +Italics and bold: 3-quote opening sequence: (3,5) (parsoid) +!! options +parsoid +!! input +'''foo''''' +!! result +

foo +

+!!end ### @@ -346,13 +646,26 @@ Italics and bold: 4-quote opening sequence: (4,4) !! test -Italics and bold: 4-quote opening sequence: (4,5) +Italics and bold: 4-quote opening sequence: (4,5) (php) +!! options +php !! input ''''foo''''' !! result

'foo

!!end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +Italics and bold: 4-quote opening sequence: (4,5) (parsoid) +!! options +parsoid +!! input +''''foo''''' +!! result +

'foo +

+!!end ### @@ -361,6 +674,7 @@ Italics and bold: 4-quote opening sequence: (4,5) !! test Italics and bold: 5-quote opening sequence: (5,2) +!! options !! input '''''foo'' !! result @@ -432,23 +746,49 @@ Italics and bold: multiple quote sequences: (2,4,4) !! test -Italics and bold: multiple quote sequences: (3,4,2) +Italics and bold: multiple quote sequences: (3,4,2) (php) +!! options +php !! input '''foo''''bar'' !! result

foo'bar

!!end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +Italics and bold: multiple quote sequences: (3,4,2) (parsoid) +!! options +parsoid +!! input +'''foo''''bar'' +!! result +

foo'bar +

+!!end + - !! test -Italics and bold: multiple quote sequences: (3,4,3) +Italics and bold: multiple quote sequences: (3,4,3) (php) +!! options +php !! input '''foo''''bar''' !! result

foo'bar

!!end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +Italics and bold: multiple quote sequences: (3,4,3) (parsoid) +!! options +parsoid +!! input +'''foo''''bar''' +!! result +

foo'bar +

+!!end ### ### other quote tests @@ -485,6 +825,7 @@ Italics and bold: other quote tests: (3,2,3,2) !! test Italics and bold: other quote tests: (3,2,3,3) +!! options !! input '''this is about ''foo'''s family''' !! result @@ -512,6 +853,23 @@ The ''[[Main Page]]'''s talk page.

!! end +!! test +Parsoid only: Quote balancing context should be restricted to td/th cells on the same wikitext line +(Requires tidy for PHP parser output to be fixed up) +!! options +parsoid=wt2html,wt2wt +!! input +{| +!''a!!''b +|''a||''b +|} +!! result + + + +
abab
+!! end + ### ### Non-html5 tags ### @@ -533,6 +891,74 @@ Non-html5 tags should be accepted

!! end +!! test + is valid wikitext (bug 52468) +!! input + +!! result +

+

+!! end + +# is HTML4, is HTML4/5. +!! test + or for strikethrough +!! input +strike + +s +!! result +

strike +

s +

+!! end + +!! test +Non-word characters don't terminate tag names (bug 17663, 40670, 52022) +!! input + doesn't work! + + doesn't work! + + works fine + +foo
+ +s.foo + + +!! result +

<b→> doesn't work! </b> +

<bä> doesn't work! </b> +

<boo> works fine </b> +

<s.foo>foo</s> +

<s.foo>s.foo</s.foo> +

<sub-ID#1> +

+!! end + +### +### Special characters +### + +!! test +Bare pipe character (bug 52363) +!! input +| +!! result +

| +

+!! end + +!! test +Bare pipe character from a template (bug 52363) +!! input +{{pipe}} +!! result +

| +

+!! end + ### ### test cases ### @@ -579,15 +1005,24 @@ nowiki 3 *There is not nowiki. *There is nowiki. !! result -
There is not nowiki. -
There is nowiki. -
-
  1. There is not nowiki. -
  2. There is nowiki. -
-
  • There is not nowiki. -
  • There is nowiki. -
+
+
There is not nowiki. +
+
There is nowiki. +
+
+
    +
  1. There is not nowiki. +
  2. +
  3. There is nowiki. +
  4. +
+
    +
  • There is not nowiki. +
  • +
  • There is nowiki. +
  • +
!! end @@ -600,6 +1035,16 @@ Entities inside

!! end +!! test +Entities inside template parameters +!! options +parsoid +!! input +{{echo|–}} +!! result +

+

+!! end ### ### Comments @@ -781,7 +1226,7 @@ b !! end ### -### paragraph wraping tests +### paragraph wrapping tests ### !! test No block tags @@ -794,8 +1239,9 @@ b

b

!! end + !! test -Block tag on one line +Block tag on one line (
) !! input a
foo
@@ -807,7 +1253,19 @@ a
foo
!! end !! test -Block tag on both lines +Block tag on one line (
) +!! input +a
foo
+ +b +!! result +a
foo
+

b +

+!! end + +!! test +Block tag on both lines (
) !! input a
foo
@@ -818,6 +1276,18 @@ b
foo
!! end +!! test +Block tag on both lines (
) +!! input +a
foo
+ +b
foo
+!! result +a
foo
+b
foo
+ +!! end + !! test Multiple lines without block tags !! input @@ -837,7 +1307,7 @@ x
foo
z !! end !! test -Empty lines between block tags to test open p-tags are closed between the block tags +Empty lines between lines with block tags !! input
@@ -845,6 +1315,12 @@ Empty lines between block tags to test open p-tags are closed between the block
a b +
a
b + +
b
d + + +
e
!! result


@@ -852,6 +1328,12 @@ b

a

b

+
a
b +
b
d +


+

+
e
+ !! end ### @@ -874,6 +1356,22 @@ And a link !! end +!! test +Tabs don't trigger preformatted text +!! input + This is not + preformatted text. + This is preformatted text. + So is this. +!! result +

This is not + preformatted text. +

+
This is preformatted text.
+	So is this.
+
+!! end + !! test Ident preformatting with inline content !! input @@ -916,17 +1414,61 @@ Regression with preformatted in
!! end -# Expected output in the following test is not really expected (there should be -#
 in the output) -- it's only testing for well-formedness.
 !! test
-Bug 6200: Preformatted in 
+Bug 52763: Preformatted in
!! input
Blah
!! result
- Blah +

Blah +

+
+ +!! end + +!! test +Bug 51086: Double newlines in blockquotes should be turned into paragraphs +!! input +
+Foo + +Bar +
+!! result +
+

Foo +

Bar +

+
+ +!! end + +!! test +Bug 15491: / in blockquote +!! input +
+Foo bar baz quux +
+!! result +
+

Foo bar baz quux +

+
+ +!! end + +# Note that the p-wrapping is newline sensitive, which could be +# considered a bug: tidy will wrap only the 'Foo' in the example +# below in a

tag. (see comment 23-25 of bug #6200) +!! test +Bug 15491: / in blockquote (2) +!! input +

Foo bar baz quux +
+!! result +
Foo bar baz quux
!! end @@ -1156,82 +1698,253 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
!!end +# TODO / maybe: fix wt2wt for this !! test -Templates: Single-line variant of parameter whitespace stripping test +Parsoid: Don't paragraph-wrap fosterable content +!! options +parsoid=wt2html !! input -{{echo| a}} +{| + + -{{echo|1= a}} -{{echo|{{echo| a}}}} -{{echo|1={{echo| a}}}} +|} !! result -
a
-
-

a -

-
a
-
-

a -

+ + + + + + + + + + +
!! end !! test -Templates: Strip whitespace from named parameters, but not positional ones +Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced +!! options +parsoid=wt2html !! input -{{echo| - foo}} +{| + + + -{{echo| -* foo}} + + +|} +!! result + + + + + + + + + + +
+
+!! end + + +#-------------------------------------------------------------------- +# Transclusion parameter whitespace stripping tests +# Behavior is different for positional and named parameters +#-------------------------------------------------------------------- +!! test +Templates: Strip leading and trailing whitespace from named-param values +!! input +{{echo|1= a }} + +{{echo|1= {{echo|b}} }} {{echo| 1 = - foo}} + c }} {{echo| 1 = -* foo}} +* d +}} !! result -
foo
-
-


-

-
  • foo -
-

foo +

a +

b +

c

-
  • foo -
+
    +
  • d +
  • +
!! end -### -### Parsoid-centric tests for testing RT edge cases for pre -### +!! test +Templates: Don't strip whitespace from positional-param values +!! input +{{echo|a }} -!!test -1a. Indent-Pre and Comments -!!input - a - -c -!!result -
a
+{{echo|{{echo|b}} }}
+
+{{echo| c 
+}}
+
+{{echo| {{echo|d}}
+}}
+
+{{echo|
+ e}}
+
+{{echo|
+* f}}
+
+{{echo|
+ }}g
+!! result
+

a +

b +

+
c 
 
-

c +


-!!end - -!!test -1b. Indent-Pre and Comments -!!input - a - -c -!!result -
a
+
d
 
-

c +


+

+
e
+
+


+

+
    +
  • f +
  • +
+


+

+
g
+
+!! end + +!! test +Templates: Handle empty comment-and-ws-only lines correctly +!! input +{{echo|foo + + +bar}} +!! result +

foo +bar +

+!! end + +#-------------------------------------------------------------------- +# Transclusion parameter escaping tests +#-------------------------------------------------------------------- +!! test +Templates: Parsoid parameter escaping test 1 +!! options +parsoid +!! input +{{echo|[foo]|{{echo|[bar]}}}} +!! result +

[foo]

+!! end + +!! test +Parsoid: Pipes in external links in template parameter +!! options +parsoid +!! input +{{echo|[{{echo|http://example.com}} link]}} +!! result +

link

+!! end + +!! test +Parsoid: pipe in transclusion parameter +!! options +parsoid +!! input +{{echo|http://foo.com/a|b}} +!! result +

http://foo.com/a|b

+!! end + +!! test +Parsoid: Pipe in external link target and content in template parameter +!! options +parsoid=html2wt,wt2wt +!! input +{{echo|[http://foo.com/a|b a|b]}} +!! result +

a|b

+!! end + +!! test +Templates: Dont escape already nowiki-escaped text in template parameters +!! options +parsoid=html2wt,wt2wt +!! input +{{echo|foo|bar}} +{{echo|<div>}} +{{echo|}} +!! result +

foo|bar +<div> + +

+!! end + +## Bug 52824 +!! test +Templates: '=' char in nested transclusions should not trigger nowiki escapes or conversion to named param +!! options +parsoid=html2wt,wt2wt +!! input +{{echo|{{echo|1=bar}}}} +!! result +

bar

+!! end + +### +### Parsoid-centric tests for testing RT edge cases for pre +### + +!!test +1a. Indent-Pre and Comments +!!input + a + +c +!!result +
a
+
+

c +

+!!end + +!!test +1b. Indent-Pre and Comments +!!input + a + +c +!!result +
a
+
+

c

!!end @@ -1248,6 +1961,20 @@ c
!!end +!!test +1d. Indent-Pre and Comments +(Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order) +!!input + a + + b +!!result +
a
+
+
b
+
+!!end + !!test 2a. Indent-Pre and tables !!input @@ -1307,10 +2034,12 @@ c !!input

foo

foo
+
foo
foo !!result

foo

foo
+
foo
 foo 
 
!!end @@ -1334,6 +2063,12 @@ c foo
+
+
+foo
+
+
+
foo
@@ -1355,7 +2090,13 @@ c
- foo +

foo +

+
+
+
+foo
+
foo
@@ -1400,6 +2141,56 @@ b
 
!! end +!! test +6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content +!! input + a + + + b + + c + +d +!! result +
a
+
+b
+
+
c
+
+
+

d +

+!! end + +!! test +7a. Indent-pre and category links +!! options +parsoid=wt2html,wt2wt +!! input + [[Category:foo]] +{{echo| [[Category:foo]]}} +!! result + + + +!! end + +!! test +7b. Indent-pre and category links +!! options +parsoid=wt2html,wt2wt +!! input + [[Category:foo]] a + [[Category:foo]] {{echo|b}} +!! result +
+ a
+
+ b
+!! end + ### ### HTML-pre (some to spec PHP parser behavior and some Parsoid-RT-centric) ### @@ -1482,8 +2273,11 @@ Simple definition !! input ; name : Definition !! result -
name 
Definition -
+
+
name 
+
Definition +
+
!! end @@ -1492,8 +2286,10 @@ Definition list for indentation only !! input : Indented text !! result -
Indented text -
+
+
Indented text +
+
!! end @@ -1502,8 +2298,11 @@ Definition list with no space !! input ;name:Definition !! result -
name
Definition -
+
+
name
+
Definition +
+
!!end @@ -1512,8 +2311,11 @@ Definition list with URL link !! input ; http://example.com/ : definition !! result -
http://example.com/ 
definition -
+
+
http://example.com/ 
+
definition +
+
!! end @@ -1522,8 +2324,11 @@ 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 @@ -1532,8 +2337,11 @@ 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 @@ -1543,8 +2351,11 @@ 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 @@ -1553,8 +2364,10 @@ 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 @@ -1563,8 +2376,11 @@ 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 @@ -1573,8 +2389,10 @@ Definition lists: colon in HTML attribute !! input ;bold !! result -
bold -
+
+
bold +
+
!! end @@ -1583,8 +2401,11 @@ Definition lists: self-closed tag !! input ;one
two : two-line fun !! result -
one
two 
two-line fun -
+
+
one
two 
+
two-line fun +
+
!! end @@ -1613,16 +2434,19 @@ Definition and unordered list using wiki syntax nested in unordered list using h
  • ; term : description * unordered -
  • -
+ !! result
  • -
    term 
    description -
    -
    • unordered -
    +
    +
    term 
    +
    description +
    +
    +
      +
    • unordered
    +
!! end @@ -1633,8 +2457,11 @@ Definition list with empty definition and following paragraph ; term: Paragraph text !! result -
term
-
+
+
term
+
+
+

Paragraph text

!! end @@ -1663,10 +2490,14 @@ Definition Lists: No nesting: Multiple dd's :a :b !! result -
x -
a -
b -
+
+
x +
+
a +
+
b +
+
!! end @@ -1677,12 +2508,18 @@ Definition Lists: Indentation: Regular ::i2 :::i3 !! result -
i1 -
i2 -
i3 -
-
-
+
+
i1 +
+
i2 +
+
i3 +
+
+
+
+
+
!! end @@ -1692,11 +2529,17 @@ Definition Lists: Indentation: Missing 1st level ::i2 :::i3 !! result -
i2 -
i3 -
-
-
+
+
+
i2 +
+
i3 +
+
+
+
+
+
!! end @@ -1705,10 +2548,16 @@ Definition Lists: Indentation: Multi-level indent !! input :::i3 !! result -
i3 -
-
-
+
+
+
+
i3 +
+
+
+
+
+
!! end @@ -1732,6 +2581,21 @@ should be left alone should be left alone

!! end + +# Bug 52473 +!! test +Definition Lists: Hacky use to indent tables (WS-insensitive) +!! options +parsoid +!! input +: {| +|a +|} +!! result +
+
a
+
+!! end ## The PHP parser treats : items (dd) without a corresponding ; item (dt) ## as an empty dt item. It also ignores all but the last ";" when followed ## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in @@ -1783,13 +2647,17 @@ Table / list interaction: indented table with lists in table contents
a -
  • b -
+
    +
  • b +
  • +
c -
  • d -
+
    +
  • d +
  • +
!! end @@ -1812,18 +2680,27 @@ Table / list interaction: lists nested in tables nested in indented lists
-
a -
b -
+
+
a +
+
b +
+
-
  • c -
  • d -
+
    +
  • c +
  • +
  • d +
  • +
-
  • e -
  • f -
+
    +
  • e +
  • +
  • f +
  • +
!!end @@ -1911,43 +2788,91 @@ Definition Lists: Nesting: Test 4 ::;t3 :::d3 !! result -
t3 -
d3 -
-
-
+
+
+
+
t3 +
+
d3 +
+
+
+
+
+
!! end +## The Parsoid team believes the following three test exposes a +## bug in the PHP parser. (Parsoid team thinks the PHP parser is +## wrong to close the
after the
containing the
    .) !! test -Definition Lists: Mixed Lists: Test 1 +Definition Lists: Mixed Lists: Test 1 (php) +!! options +php !! input :;* foo ::* bar :; baz !! result -
    • foo -
    • bar -
    -
    -
    baz -
    -
    - -!! end - - +
    +
    +
      +
    • foo +
    • +
    • bar +
    • +
    +
    +
    +
    +
    baz +
    +
    +
    +
    + +!! end +!! test +Definition Lists: Mixed Lists: Test 1 (parsoid) +!! options +parsoid +!! input +:;* foo +::* bar +:; baz +!! result +
    +
    +
      +
    • foo +
    • +
    +
      +
    • bar +
    • +
    +
    baz
    +
    +
    +!! end + !! test Definition Lists: Mixed Lists: Test 2 !! input *: d1 *: d2 !! result -
    • d1 -
      d2 -
      -
    +
      +
    • +
      d1 +
      +
      d2 +
      +
      +
    • +
    !! end @@ -1958,12 +2883,21 @@ Definition Lists: Mixed Lists: Test 3 *::: d1 *::: d2 !! result -
    • d1 -
      d2 -
      -
      -
      -
    +
      +
    • +
      +
      +
      d1 +
      +
      d2 +
      +
      +
      +
      +
      +
      +
    • +
    !! end @@ -1974,10 +2908,17 @@ Definition Lists: Mixed Lists: Test 4 *;d1 :d2 *;d3 :d4 !! result -
    • d1 
      d2 -
      d3 
      d4 -
      -
    +
      +
    • +
      d1 
      +
      d2 +
      +
      d3 
      +
      d4 +
      +
      +
    • +
    !! end @@ -1988,11 +2929,17 @@ Definition Lists: Mixed Lists: Test 5 *:d1 *:: d2 !! result -
    • d1 -
      d2 -
      -
      -
    +
      +
    • +
      d1 +
      +
      d2 +
      +
      +
      +
      +
    • +
    !! end @@ -2003,13 +2950,23 @@ Definition Lists: Mixed Lists: Test 6 #*:d1 #*::: d3 !! result -
      • d1 -
        d3 -
        -
        -
        -
      -
    +
      +
      • +
      • +
        d1 +
        +
        +
        d3 +
        +
        +
        +
        +
        +
        +
      • +
      +
    1. +
    !! end @@ -2020,10 +2977,15 @@ Definition Lists: Mixed Lists: Test 7 :* d1 :* d2 !! result -
    • d1 -
    • d2 -
    -
    +
    +
      +
    • d1 +
    • +
    • d2 +
    • +
    +
    +
    !! end @@ -2034,12 +2996,20 @@ Definition Lists: Mixed Lists: Test 8 :* d1 ::* d2 !! result -
    • d1 -
    -
    • d2 -
    -
    -
    +
    +
      +
    • d1 +
    • +
    +
    +
      +
    • d2 +
    • +
    +
    +
    +
    +
    !! end @@ -2049,9 +3019,14 @@ Definition Lists: Mixed Lists: Test 9 !! input *;foo :bar !! result -
    • foo 
      bar -
      -
    +
      +
    • +
      foo 
      +
      bar +
      +
      +
    • +
    !! end @@ -2061,50 +3036,171 @@ Definition Lists: Mixed Lists: Test 10 !! input *#;foo :bar !! result -
      1. foo 
        bar -
        -
      -
    +
      +
      1. +
      2. +
        foo 
        +
        bar +
        +
        +
      3. +
      +
    • +
    !! end +# The Parsoid team disagrees with the PHP parser's seemingly-random +# rules regarding dd/dt on the next two tests. Parsoid is more +# consistent, and recognizes the shared nesting and keeps the +# still-open tags around until the nesting is complete. !! test -Definition Lists: Mixed Lists: Test 11 +Definition Lists: Mixed Lists: Test 11 (php) +!! options +php !! input *#*#;*;;foo :bar *#*#;boo :baz !! result -
          1. foo 
            • bar -
              -
            -
        -
-
boo 
baz -
- - - - +
    +
    1. +
      • +
        1. +
        2. +
          foo 
          +
            +
          • +
            +
            bar +
            +
            +
          +
          +
        3. +
      + + +
      +
      boo 
      +
      baz +
      +
      +
    2. +
    +
  • +
+ + + + !! end +!! test +Definition Lists: Mixed Lists: Test 11 (parsoid) +!! options +parsoid +!! input +*#*#;*;;foo :bar +*#*#;boo :baz +!! result +
    +
  • +
      +
    1. +
        +
      • +
          +
        1. +
          +
          +
            +
          • +
            +
            +
            +
            foo 
            +
            bar
            +
            +
          • +
          +
          boo 
          +
          baz
          +
        2. +
      • +
    2. +
  • +
+!! end !! test -Definition Lists: Weird Ones: Test 1 +Definition Lists: Weird Ones: Test 1 (php) +!! options +php !! input *#;*::;; foo : bar (who uses this?) !! result -
    1. foo 
      • bar (who uses this?) -
        -
        -
        -
      -
- - - +
    +
    1. +
    2. +
      foo 
      +
        +
      • +
        +
        +
        +
        bar (who uses this?) +
        +
        +
        +
        +
        +
        +
      +
      +
    3. +
+ + + + + + +!! end +!! test +Definition Lists: Weird Ones: Test 1 (parsoid) +!! options +parsoid +!! input +*#;*::;; foo : bar (who uses this?) +!! result +
    +
  • +
      +
    1. +
      +
      +
        +
      • +
        +
        +
        +
        +
        +
        +
        +
        foo 
        +
        bar (who uses this?)
        +
        +
        +
        +
      • +
      +
    2. +
  • +
!! end ### @@ -2269,6 +3365,17 @@ External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png

!! end +!! test +External image (when not allowed) +!! options +wgAllowExternalImages=0 +!! input +External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png +!! result +

External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png +

+!! end + !! test Link to non-http image, no img tag !! input @@ -2691,6 +3798,15 @@ External link containing double-single-quotes with no space separating the url f

!! end +!! test +External link with comments in link text +!! input +[http://www.google.com Google ] +!! result +

Google +

+!! end + !! test URL-encoding in URL functions (single parameter) !! input @@ -2763,6 +3879,28 @@ Non-extlinks in brackets

!! end +!! test +Parsoid: Percent encoding in external links +!! options +parsoid +!! input +[https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search] +!! result +

Search

+!! end + +!! test +Parsoid: use url link syntax for links where the content is equal the link +target +!! options +parsoid +!! input +http://example.com +!! result +

http://example.com

+!! end + ### ### Quotes ### @@ -2781,7 +3919,9 @@ Normal text. '''''Bold italic text.''''' Normal text. !! test -Unclosed and unmatched quotes +Unclosed and unmatched quotes (php) +!! options +php !! input '''''Bold italic text '''with bold deactivated''' in between.''''' @@ -2816,6 +3956,47 @@ Plain ''italic'''s plain

Plain italic's plain

!! end +# Parsoid inserts an empty bold tag pair at the end of the line, that the PHP +# parser strips. The wikitext contains just the first half of the bold +# quote pair. +!! test +Unclosed and unmatched quotes (parsoid) +!! options +parsoid +!! input +'''''Bold italic text '''with bold deactivated''' in between.''''' + +'''''Bold italic text ''with italic deactivated'' in between.''''' + +'''Bold text.. + +..spanning two paragraphs (should not work).''' + +'''Bold tag left open + +''Italic tag left open + +Normal text. + + +'''This year''''s election ''should'' beat '''last year''''s. + +''Tom'''s car is bigger than ''Susan'''s. + +Plain ''italic'''s plain +!! result +

Bold italic text with bold deactivated in between. +

Bold italic text with italic deactivated in between. +

Bold text.. +

..spanning two paragraphs (should not work). +

Bold tag left open +

Italic tag left open +

Normal text. +

This year's election should beat last year's. +

Toms car is bigger than Susans. +

Plain italic's plain +

+!! end ### ### Tables @@ -2824,19 +4005,33 @@ Plain ''italic'''s plain ### # This should not produce
as
-# is the bare minimun required by the spec, see: +# is the bare minimum required by the spec, see: # http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables !! test -A table with no data. +A table with no data. (php) +!! options +php +!! input +{||} +!! result +!! end +# Parsoid team replies: empty table tags are legal in HTML5 +!! test +A table with no data. (parsoid) +!! options +parsoid !! input {||} !! result +
!! end # A table with nothing but a caption is invalid XHTML, we might want to render # this as

caption

!! test -A table with nothing but a caption +A table with nothing but a caption (php) +!! options +php !! input {| |+ caption @@ -2847,13 +4042,25 @@ A table with nothing but a caption !! end - +# Parsoid team replies: table with only a caption is legal in HTML5 !! test -A table with caption with default-spaced attributes and a table row +A table with nothing but a caption (parsoid) +!! options +parsoid !! input {| -|+ style="color: red;" | caption1 -|- +|+ caption +|} +!! result +
caption
+!! end + +!! test +A table with caption with default-spaced attributes and a table row +!! input +{| +|+ style="color: red;" | caption1 +|- | foo |} !! result @@ -3243,11 +4450,44 @@ Template-generated table cell attributes and cell content !! input {| |{{table_attribs}} +| {{table_attribs}} |} !! result +
Foo + Foo +
+ +!! end + +!! test +Template-generated table cell attributes and cell content (2) +!! input +{| +|align=center {{table_attribs}} +|} +!! result + + +
Foo +
+ +!! end + +!! test +Template-generated table cell attributes and cell content (3) +!! input +{| +|align=center {{table_cells}} +|} +!! result + + + + +
Foo Bar Baz
!! end @@ -3270,21 +4510,40 @@ Table with row followed by newlines and table heading !! end +!! test +Table with empty line following the start tag +!! input +{| + +|- +| foo +|} +!! result + + + + +
foo +
+ +!! end + # FIXME: Preserve the attribute properly (with an empty string as value) in # the PHP parser. Parsoid implements the behavior below. !! test Table attributes with empty value !! options -disabled +parsoid !! input {| | style=| hello |} !! result +
hello -
+ !! end @@ -3311,6 +4570,159 @@ Wikitext table with a lot of comments !! end +!! test +Wikitext table with double-line table cell +!! input +{| +|a +b +|} +!! result + + +
a +

b +

+
+ +!! end + +!! test +Table cell with a single comment +!! input +{| +| +| a +|} +!! result + + + +
+ a +
+ +!! end + +# The expected HTML structure in this test is debatable. The PHP parser does +# not parse this kind of table at all. The main focus for Parsoid is on +# round-tripping, so this output is ok for now. TODO: revisit! +!! test +Wikitext table with html-syntax row (Parsoid) +!! options +parsoid +!! input +{| +|- +foo +|} +!! result + + + +
foo
+!! end + +!! test +Implicit after a |- +(PHP parser relies on Tidy to add the missing tags) +!! options +parsoid=wt2html,wt2wt +!! input +{| +|- +a +|} +!! result + + +
a
+!! end + +!! test +Pres should be recognized in an explicit context, but not in an implicit context +(PHP parser relies on Tidy to add the missing tags) +!! options +parsoid=wt2html,wt2wt +!! input +{| +|- +| + a +|- + b +|} +!! result + + + + + +
a
b
+!! end + +!! test +Lists should be recognized in an implicit context +(PHP parser relies on Tidy to add the missing tags) +!! options +parsoid=wt2html,wt2wt +!! input +{| +|- +*a +|} +!! result + + + + +
    +
  • a
  • +
+!! end + +!! test +Parsoid: Round-trip tables directly followed by content (bug 51219) +!! options +parsoid=wt2html,wt2wt +!! input +{| +|foo +|} bar + +{| +|baz +|}quux +!! result + + +
foo
bar + + + +
baz
quux +!! end + +!! test +Parsoid: Default to a newline after tables in new content (bug 51219) +!! options +parsoid=html2wt +!! input +{| +|foo +|} + bar +{| +|baz +|} +'''quux''' +!! result + +
foo
bar + +
baz
quux +!! end + ### ### Internal links ### @@ -3341,6 +4753,15 @@ Piped link

!! end +!! test +Piped link with comment in link text +!! input +[[Main Page|The Main Page]] +!! result +

The Main Page +

+!! end + !! test Broken link !! input @@ -3462,6 +4883,22 @@ Link to namespaces

!! end +!! article +MemoryAlpha:AlphaTest +!! text +This is an article in the MemoryAlpha namespace +(which shadows the memoryalpha interwiki link). +!! endarticle + +!! test +Namespace takes precedence over interwiki link (bug 51680) +!! input +[[MemoryAlpha:AlphaTest]] +!! result +

MemoryAlpha:AlphaTest +

+!! end + !! test Piped link to namespace !! input @@ -3526,6 +4963,33 @@ Link containing "<#" and ">#" as a hex sequences

!! end +!! test +Link containing an equals sign +!! input +[[Special:BookSources/isbn=4-00-026157-6]] +!! result +

Special:BookSources/isbn=4-00-026157-6 +

+!! end + +!! article +Foo~bar +!! text +Just a test of an article title containing a tilde. +!! endarticle + +# note that links containing signatures, like [[Foo~~~~]], are +# massaged by the pre-save transform (PST) and so the tildes are never +# seen by the parser. +!! test +Link containing a tilde +!! input +[[Foo~bar]] +!! result +

Foo~bar +

+!! end + !! test Link containing double-single-quotes '' (bug 4598) !! input @@ -3787,6 +5251,69 @@ language=kaa

!! end +!! article +Söfnuður +!! text +Test. +!! endarticle + +!! test +Internal link with is link prefix +!! options +language=is +!! input +Aðrir mótmælenda[[söfnuður|söfnuðir]] og +!! result +

Aðrir mótmælendasöfnuðir og +

+!! end + +!! article +Mótmælendatrú +!! text +Test. +!! endarticle + +!! test +Internal link with is link trail and link prefix +!! options +language=is +!! input +[[mótmælendatrú|xxx]]ar +[[mótmælendatrú]]ar +mótmælenda[[söfnuður]] +mótmælenda[[söfnuður|söfnuðir]] +mótmælenda[[söfnuður|söfnuðir]]xxx +!! result +

xxxar +mótmælendatrúar +mótmælendasöfnuður +mótmælendasöfnuðir +mótmælendasöfnuðirxxx +

+!! end + +!! test +Parsoid link trail escaping +!! options +parsoid=html2wt,html2html +!! input +[[apple]]s +!! result +

apples

+!! end + +!! test +Parsoid link prefix escaping +!! options +language=is +parsoid=html2wt,html2html +!! input +Aðrir mótmælenda[[söfnuður]] +!! result +

Aðrir mótmælendasöfnuður

+!! end + !! test Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved !! input @@ -3833,9 +5360,12 @@ Interwiki link encoding conversion (bug 1636) *[[Wikipedia:ro:Olteniţa]] *[[Wikipedia:ro:Olteniţa]] !! result - + !! end @@ -3848,6 +5378,12 @@ Interwiki link with fragment (bug 2130)

!! end + +### +### Interlanguage links +### Language links (so that searching for '### language' matches..) +### + !! test Interlanguage link !! input @@ -3905,21 +5441,206 @@ language=ln

!! end -## -## XHTML tidiness -### - !! test -
to
+Parsoid bug 53221: Wikilinks should be properly entity-escaped +!! options +parsoid=html2wt !! input -1
2
3 -!! result -

1
2
3 -

+He&nbsp;llo [[Foo|He&nbsp;llo]] + +He&nbsp;llo [[He&nbsp;llo]] +!!result +

He&nbsp;llo He&nbsp;llo

+

He&nbsp;llo He&nbsp;llo

!! end !! test -Broken br tag sanitization +Parsoid: handle constructor well +!! options +parsoid +!! input +[[constructor]] + +[[constructor:foo]] +!! result +

constructor

+ + +

constructor:foo

+!! end + +!! test +Parsoid: recognize interlanguage links without a target page +!! options +parsoid +!! input +[[ko:]] +!! result +

+

+!! end + +!! test +Parsoid: recognize interwiki links without a target page +!! options +parsoid +!! input +[[:ko:]] +!! result +

ko:

+!! end + +### +### Redirects, Parsoid-only +### +!! test +Simple redirect to page +!! options +parsoid +!! input +#REDIRECT [[Main Page]] +!! result + +!! end + +!! test +Optional colon in #REDIRECT +!! options +# the colon is archaic syntax. we support it for wt2html, but we +# don't care that it roundtrips back to the modern syntax. +parsoid=wt2html,html2html +!! input +#REDIRECT:[[Main Page]] +!! result + +!! end + +!! test +Whitespace in #REDIRECT with optional colon +!! options +# the colon and gratuitous whitespace is archaic syntax. we support +# it for wt2html, but we don't care that it roundtrips back to the +# modern syntax (without extra whitespace) +parsoid=wt2html,html2html +!! input + + #REDIRECT +: +[[Main Page]] +!! result + +!! end + +!! test +Piped link in #REDIRECT +!! options +# content after piped link is ignored. we support this syntax, +# but don't care that the piped link is lost when we roundtrip this. +parsoid=wt2html +!! input +#REDIRECT [[Main Page|bar]] +!! result + +!! end + +!! test +Redirect to category +!! options +parsoid=wt2html +!! input +#REDIRECT [[Category:Foo]] +!! result + +!! end + +!! test +Redirect to category with URL encoding +!! options +parsoid=wt2html +!! input +#REDIRECT [[Category%3AFoo]] +!! result + +!! end + +!! test +Redirect to category page +!! options +parsoid=wt2html,html2html +!! input +#REDIRECT [[:Category:Foo]] +!! result +

Category:Foo

+!! end + +!! test +Redirect to image page (1) +!! options +parsoid +!! input +#REDIRECT [[File:Wiki.png]] +!! result + +!! end + +!! test +Redirect to image page (2) +!! options +parsoid +!! input +#REDIRECT [[Image:Wiki.png]] +!! result + +!! end + +!! test +Redirect to language +!! options +parsoid +!! input +#REDIRECT [[en:File:Wiki.png]] +!! result + +!! end + +!! test +Redirect to interwiki +!! options +parsoid +!! input +#REDIRECT [[meatball:File:Wiki.png]] +!! result + +!! end + +!! test +Non-English #REDIRECT +!! options +parsoid +language=is +!! input +#TILVÍSUN [[Main Page]] +!! result + +!! end + +## +## XHTML tidiness +### + +!! test +
to
+!! input +1
2
3 +!! result +

1
2
3 +

+!! end + +!! test +Broken br tag sanitization +!! options +php !! input
!! result @@ -3927,6 +5648,17 @@ Broken br tag sanitization

!! end +# TODO: Fix html2html mode (bug 51055)! +!! test +Parsoid: Broken br tag recognition +!! options +parsoid=wt2html +!! input +
+!! result +


+!! end + !! test Incorrecly removing closing slashes from correctly formed XHTML !! input @@ -4023,7 +5755,7 @@ Horizontal ruler -- eats additional dashes on the same line !! end !! test -Horizontal ruler -- does not collaps dashes on consecutive lines +Horizontal ruler -- does not collapse dashes on consecutive lines !! input ---- ---- @@ -4061,10 +5793,14 @@ Common list * item 2 *item 3 !! result -
  • Common list -
  • item 2 -
  • item 3 -
+
    +
  • Common list +
  • +
  • item 2 +
  • +
  • item 3 +
  • +
!! end @@ -4075,10 +5811,14 @@ Numbered list #item 2 # item 3 !! result -
  1. Numbered list -
  2. item 2 -
  3. item 3 -
+
    +
  1. Numbered list +
  2. +
  3. item 2 +
  4. +
  5. item 3 +
  6. +
!! end @@ -4101,35 +5841,67 @@ Mixed list *** Level 3 #** Level 3, but ordered !! result -
  • Mixed list -
    1. with numbers -
    -
    • and bullets -
    -
    1. and numbers -
    -
  • bullets again -
    • bullet level 2 -
      • bullet level 3 -
        1. Number on level 4 -
        -
      -
    • bullet level 2 -
      1. Number on level 3 -
      2. Number on level 3 -
      -
    -
    1. number level 2 -
    -
  • Level 1 -
      • Level 3 -
      -
    -
-
      • Level 3, but ordered -
      -
    -
+
    +
  • Mixed list +
      +
    1. with numbers +
    2. +
    +
      +
    • and bullets +
    • +
    +
      +
    1. and numbers +
    2. +
    +
  • +
  • bullets again +
      +
    • bullet level 2 +
        +
      • bullet level 3 +
          +
        1. Number on level 4 +
        2. +
        +
      • +
      +
    • +
    • bullet level 2 +
        +
      1. Number on level 3 +
      2. +
      3. Number on level 3 +
      4. +
      +
    • +
    +
      +
    1. number level 2 +
    2. +
    +
  • +
  • Level 1 +
      +
      • +
      • Level 3 +
      • +
      +
    • +
    +
  • +
+
    +
    • +
      • +
      • Level 3, but ordered +
      • +
      +
    • +
    +
  1. +
!! end @@ -4139,10 +5911,14 @@ Nested lists 1 *foo **bar !! result -
  • foo -
    • bar -
    -
+
    +
  • foo +
      +
    • bar +
    • +
    +
  • +
!! end @@ -4152,10 +5928,15 @@ Nested lists 2 **foo *bar !! result -
    • foo -
    -
  • bar -
+
    +
    • +
    • foo +
    • +
    +
  • +
  • bar +
  • +
!! end @@ -4165,10 +5946,14 @@ Nested lists 3 (first element empty) * **bar !! result -
  • -
    • bar -
    -
+
    +
  • +
      +
    • bar +
    • +
    +
  • +
!! end @@ -4178,10 +5963,15 @@ Nested lists 4 (first element empty) ** *bar !! result -
    • -
    -
  • bar -
+
    +
    • +
    • +
    • +
    +
  • +
  • bar +
  • +
!! end @@ -4191,10 +5981,15 @@ Nested lists 5 (both elements empty) ** * !! result -
    • -
    -
  • -
+
    +
    • +
    • +
    • +
    +
  • +
  • +
  • +
!! end @@ -4204,10 +5999,14 @@ Nested lists 6 (both elements empty) * ** !! result -
  • -
    • -
    -
+
    +
  • +
      +
    • +
    • +
    +
  • +
!! end @@ -4216,10 +6015,16 @@ Nested lists 7 (skip initial nesting levels) !! input *** foo !! result -
      • foo -
      -
    -
+
    +
    • +
      • +
      • foo +
      • +
      +
    • +
    +
  • +
!! end @@ -4231,16 +6036,24 @@ Nested lists 8 (multiple nesting transitions) ** baz * boo !! result -
  • foo -
      • bar -
      -
    • baz -
    -
  • boo -
- -!! end - +
    +
  • foo +
      +
      • +
      • bar +
      • +
      +
    • +
    • baz +
    • +
    +
  • +
  • boo +
  • +
+ +!! end + !! test 1. Lists with start-of-line-transparent tokens before bullets: Comments !! input @@ -4248,10 +6061,14 @@ Nested lists 8 (multiple nesting transitions) *bar *baz !! result -
  • foo -
  • bar -
  • baz -
+
    +
  • foo +
  • +
  • bar +
  • +
  • baz +
  • +
!! end @@ -4261,78 +6078,14 @@ Nested lists 8 (multiple nesting transitions) *foo {{echo|bar }}*baz !! result -
  • foo bar -
  • baz -
- -!! end - -!! test -Unbalanced closing block tags break a list -(Disabled since php parser generates broken html -- relies on Tidy to fix up) -!! options -disabled -!! input -
-*a
-*b
-!! result -
-
  • a -
-
  • b -
-!! end - -!! test -Unbalanced closing non-block tags don't break a list -(Disabled since php parser generates broken html -- relies on Tidy to fix up) -!! options -disabled -!! input - -*a -*b -!! result -

-

-
  • a -
  • b -
-!! end - -!! test -Unclosed formatting tags that straddle lists are closed and reopened -(Disabled since php parser generates broken html -- relies on Tidy to fix up) -!! options -disabled -!! input -# a -# b -!! result -
  1. a -
  2. b -
-!! end - -!!test -List embedded in a non-block tag -(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy) -!! options -parsoid -!!input - -* foo - -!!result -

-
    -
  • foo
  • +
  • foo bar +
  • +
  • baz +
-
-

-!!end + +!! end !! test List items are not parsed correctly following a
 block (bug 785)
@@ -4341,10 +6094,14 @@ List items are not parsed correctly following a 
 block (bug 785)
 * 
bar
* zar !! result -
  • foo
    -
  • bar
    -
  • zar -
+
    +
  • foo
    +
  • +
  • bar
    +
  • +
  • zar +
  • +
!! end @@ -4363,18 +6120,30 @@ List items from template * notSOL{{inner list}} * item 2 !! result -
  • item 1 -
  • item 2 -
-
  • item 0 -
  • item 1 -
  • item 2 -
-
  • item 0 -
  • notSOL -
  • item 1 -
  • item 2 -
+
    +
  • item 1 +
  • +
  • item 2 +
  • +
+
    +
  • item 0 +
  • +
  • item 1 +
  • +
  • item 2 +
  • +
+
    +
  • item 0 +
  • +
  • notSOL +
  • +
  • item 1 +
  • +
  • item 2 +
  • +
!! end @@ -4387,14 +6156,22 @@ List interrupted by empty line or heading == A heading == * Another list item !! result -
  • foo -
-
    • bar -
    -
-

[edit] A heading

-
  • Another list item -
+
    +
  • foo +
  • +
+
    +
    • +
    • bar +
    • +
    +
  • +
+

A heading[edit]

+
    +
  • Another list item +
  • +
!!end @@ -4413,1629 +6190,2281 @@ Multiple list tags generated by templates !!end -### -### Magic Words -### +!!test +Single-comment whitespace lines dont break lists, and neither do multi-comment whitespace lines +!!input +*a + +*b + +*c + +*d +!!result +
    +
  • a +
  • +
  • b +
  • +
  • c +
  • +
  • d +
  • +
-!! test -Magic Word: {{CURRENTDAY}} -!! input -{{CURRENTDAY}} -!! result -

1 -

-!! end +!!end -!! test -Magic Word: {{CURRENTDAY2}} -!! input -{{CURRENTDAY2}} -!! result -

01 -

-!! end +!!test +Replacing whitespace with tabs still doesn't break the list (gerrit 78327) +!!input +*a + +*b + +*c + +*d +!!result +
    +
  • a +
  • +
  • b +
  • +
  • c +
  • +
  • d +
  • +
+ +!!end + +!!test +Test the li-hack +(Cannot test this with PHP parser since it relies on Tidy for the hack) +!!options +parsoid=wt2html,wt2wt +!!input +* foo +*
  • li-hack +* {{echo|
  • templated li-hack}} +*
  • unsupported li-hack with preceding comments + +
      +
    • not a li-hack +
    • +
    +!!result +
      +
    • foo
    • +
    • li-hack
    • +
    • templated li-hack
    • +
    • +
    • li-hack with preceding comments
    • +
    + +
      +
    • +
    • not a li-hack +
    • +
    +!!end !! test -Magic Word: {{CURRENTDAYNAME}} +Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines +!! options +parsoid !! input -{{CURRENTDAYNAME}} +# foo +## bar +* foo +** bar +: foo +:: bar !! result -

    Thursday -

    +
      +
    1. foo
        +
      1. bar
      2. +
    2. +
      +
    • foo
        +
      • bar
      • +
    • +
    +
    foo
    +
    bar
    +
    +
    !! end !! test -Magic Word: {{CURRENTDOW}} +Parsoid: Test of whitespace serialization with Templated bullets +!! options +parsoid !! input -{{CURRENTDOW}} +* {{bullet}} !! result -

    4 -

    +
      +
    • Bar
    • +
    !! end +# ------------------------------------------------------------------------ +# The next set of tests are about Parsoid's ability to handle badly nested +# tags (parse, minimize scope of fixup, and roundtrip back) +# ------------------------------------------------------------------------ + !! test -Magic Word: {{CURRENTMONTH}} +Unbalanced closing block tags break a list +(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) +!! options +parsoid !! input -{{CURRENTMONTH}} +
    +*a
    +*b
    !! result -

    01 -

    +
    +
      +
    • a +
    • +
    +
      +
    • b +
    • +
    !! end !! test -Magic Word: {{CURRENTMONTHABBREV}} +Unbalanced closing non-block tags don't break a list +(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) +!! options +parsoid !! input -{{CURRENTMONTHABBREV}} + +*a +*b !! result -

    Jan +

    +
      +
    • a +
    • +
    • b +
    • +
    !! end !! test -Magic Word: {{CURRENTMONTHNAME}} +Unclosed formatting tags that straddle lists are closed and reopened +(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up) +!! options +parsoid !! input -{{CURRENTMONTHNAME}} +# a +# b !! result -

    January -

    +
      +
    1. a +
    2. +
    3. b +
    4. +
    !! end -!! test -Magic Word: {{CURRENTMONTHNAMEGEN}} -!! input -{{CURRENTMONTHNAMEGEN}} -!! result -

    January -

    -!! end +!!test +List embedded in a non-block tag +(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy) +!! options +parsoid +!!input + +* foo + +!!result +

    + +
      +
    • foo
    • +
    +
    +

    +!!end !! test -Magic Word: {{CURRENTTIME}} +Table with missing opening tag +!! options +parsoid=wt2html,wt2wt !! input -{{CURRENTTIME}} + + + +
    foo
    !! result -

    00:02 -

    + + + + +
    foo
    !! end +### +### Magic Words +### + +# Note that the current date is hard-coded as +# 1970-01-01T00:02:03Z (a Thursday) +# when running parser tests. The timezone is also fixed to GMT, so +# local date will be identical to current date. + !! test -Magic Word: {{CURRENTWEEK}} (@bug 4594) +Magic Word: {{CURRENTDAY}} !! input -{{CURRENTWEEK}} +{{CURRENTDAY}} !! result

    1

    !! end !! test -Magic Word: {{CURRENTYEAR}} +Magic Word: {{CURRENTDAY2}} !! input -{{CURRENTYEAR}} +{{CURRENTDAY2}} !! result -

    1970 +

    01

    !! end !! test -Magic Word: {{FULLPAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTDAYNAME}} !! input -{{FULLPAGENAME}} +{{CURRENTDAYNAME}} !! result -

    User:Ævar Arnfjörð Bjarmason +

    Thursday

    !! end !! test -Magic Word: {{FULLPAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTDOW}} !! input -{{FULLPAGENAMEE}} +{{CURRENTDOW}} !! result -

    User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +

    4

    !! end !! test -Magic Word: {{NAMESPACE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTMONTH}} !! input -{{NAMESPACE}} +{{CURRENTMONTH}} !! result -

    User +

    01

    !! end !! test -Magic Word: {{NAMESPACEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTMONTH1}} !! input -{{NAMESPACEE}} +{{CURRENTMONTH1}} !! result -

    User +

    1

    !! end !! test -Magic Word: {{NAMESPACENUMBER}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTMONTHABBREV}} !! input -{{NAMESPACENUMBER}} +{{CURRENTMONTHABBREV}} !! result -

    2 +

    Jan

    !! end !! test -Magic Word: {{NUMBEROFFILES}} +Magic Word: {{CURRENTMONTHNAME}} !! input -{{NUMBEROFFILES}} +{{CURRENTMONTHNAME}} !! result -

    2 +

    January

    !! end !! test -Magic Word: {{PAGENAME}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTMONTHNAMEGEN}} !! input -{{PAGENAME}} +{{CURRENTMONTHNAMEGEN}} !! result -

    Ævar Arnfjörð Bjarmason +

    January

    !! end !! test -Magic Word: {{PAGENAME}} with metacharacters -!! options -title=[['foo & bar = baz']] +Magic Word: {{CURRENTTIME}} !! input -''{{PAGENAME}}'' +{{CURRENTTIME}} !! result -

    'foo & bar = baz' +

    00:02

    !! end !! test -Magic Word: {{PAGENAME}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] +Magic Word: {{CURRENTHOUR}} !! input -{{PAGENAME}} +{{CURRENTHOUR}} !! result -

    *RFC 1234 http://example.com/ +

    00

    !! end !! test -Magic Word: {{PAGENAMEE}} -!! options -title=[[User:Ævar Arnfjörð Bjarmason]] +Magic Word: {{CURRENTWEEK}} (@bug 4594) !! input -{{PAGENAMEE}} +{{CURRENTWEEK}} !! result -

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +

    1

    !! end !! test -Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781) -!! options -title=[[*RFC 1234 http://example.com/]] +Magic Word: {{CURRENTYEAR}} !! input -{{PAGENAMEE}} +{{CURRENTYEAR}} !! result -

    *RFC_1234_http://example.com/ +

    1970

    !! end !! test -Magic Word: {{REVISIONID}} +Magic Word: {{CURRENTTIMESTAMP}} !! input -{{REVISIONID}} +{{CURRENTTIMESTAMP}} !! result -

    1337 +

    19700101000203

    !! end !! test -Magic Word: {{SCRIPTPATH}} +Magic Words LOCAL (UTC) !! input -{{SCRIPTPATH}} +* {{LOCALMONTH}} +* {{LOCALMONTH1}} +* {{LOCALMONTHNAME}} +* {{LOCALMONTHNAMEGEN}} +* {{LOCALMONTHABBREV}} +* {{LOCALDAY}} +* {{LOCALDAY2}} +* {{LOCALDAYNAME}} +* {{LOCALYEAR}} +* {{LOCALTIME}} +* {{LOCALHOUR}} +* {{LOCALWEEK}} +* {{LOCALDOW}} +* {{LOCALTIMESTAMP}} !! result -

    / +

      +
    • 01 +
    • +
    • 1 +
    • +
    • January +
    • +
    • January +
    • +
    • Jan +
    • +
    • 1 +
    • +
    • 01 +
    • +
    • Thursday +
    • +
    • 1970 +
    • +
    • 00:02 +
    • +
    • 00 +
    • +
    • 1 +
    • +
    • 4 +
    • +
    • 19700101000203 +
    • +
    + +!! end + +!! test +Magic Word: {{FULLPAGENAME}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] +!! input +{{FULLPAGENAME}} +!! result +

    User:Ævar Arnfjörð Bjarmason

    !! end !! test -Magic Word: {{SERVER}} +Magic Word: {{FULLPAGENAMEE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{SERVER}} +{{FULLPAGENAMEE}} !! result -

    http://example.org +

    User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end !! test -Magic Word: {{SERVERNAME}} +Magic Word: {{TALKSPACE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{SERVERNAME}} +{{TALKSPACE}} !! result -

    example.org +

    User talk

    !! end !! test -Magic Word: {{SITENAME}} +Magic Word: {{TALKSPACE}}, same namespace +!! options +title=[[User talk:Ævar Arnfjörð Bjarmason]] !! input -{{SITENAME}} +{{TALKSPACE}} !! result -

    MediaWiki +

    User talk

    !! end !! test -Namespace 1 {{ns:1}} +Magic Word: {{TALKSPACE}}, main namespace +!! options +title=[[Parser Test]] !! input -{{ns:1}} +{{TALKSPACE}} !! result

    Talk

    !! end !! test -Namespace 1 {{ns:01}} +Magic Word: {{TALKSPACEE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{ns:01}} +{{TALKSPACEE}} !! result -

    Talk +

    User_talk

    !! end !! test -Namespace 0 {{ns:0}} (bug 4783) +Magic Word: {{SUBJECTSPACE}} +!! options +title=[[User talk:Ævar Arnfjörð Bjarmason]] !! input -{{ns:0}} +{{SUBJECTSPACE}} !! result +

    User +

    +!! end +!! test +Magic Word: {{SUBJECTSPACE}}, same namespace +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] +!! input +{{SUBJECTSPACE}} +!! result +

    User +

    !! end !! test -Namespace 0 {{ns:00}} (bug 4783) +Magic Word: {{SUBJECTSPACE}}, main namespace +!! options +title=[[Parser Test]] !! input -{{ns:00}} +{{SUBJECTSPACE}} !! result !! end !! test -Namespace -1 {{ns:-1}} +Magic Word: {{SUBJECTSPACEE}} +!! options +title=[[User talk:Ævar Arnfjörð Bjarmason]] !! input -{{ns:-1}} +{{SUBJECTSPACEE}} !! result -

    Special +

    User

    !! end !! test -Namespace User {{ns:User}} +Magic Word: {{NAMESPACE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{ns:User}} +{{NAMESPACE}} !! result

    User

    !! end !! test -Namespace User talk {{ns:User_talk}} +Magic Word: {{NAMESPACEE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{ns:User_talk}} +{{NAMESPACEE}} !! result -

    User talk +

    User

    !! end !! test -Namespace User talk {{ns:uSeR tAlK}} +Magic Word: {{NAMESPACENUMBER}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{ns:uSeR tAlK}} +{{NAMESPACENUMBER}} !! result -

    User talk +

    2

    !! end !! test -Namespace File {{ns:File}} +Magic Word: {{SUBPAGENAME}} +!! options +title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage !! input -{{ns:File}} +{{SUBPAGENAME}} !! result -

    File +

    sub ö

    !! end !! test -Namespace File {{ns:Image}} +Magic Word: {{SUBPAGENAMEE}} +!! options +title=[[Ævar Arnfjörð Bjarmason/sub ö]] subpage !! input -{{ns:Image}} +{{SUBPAGENAMEE}} !! result -

    File +

    sub_%C3%B6

    !! end !! test -Namespace (lang=de) Benutzer {{ns:User}} +Magic Word: {{ROOTPAGENAME}} !! options -language=de +title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage !! input -{{ns:User}} +{{ROOTPAGENAME}} !! result -

    Benutzer +

    Ævar Arnfjörð Bjarmason

    !! end !! test -Namespace (lang=de) Benutzer Diskussion {{ns:3}} +Magic Word: {{ROOTPAGENAMEE}} !! options -language=de +title=[[Ævar Arnfjörð Bjarmason/sub/sub2]] subpage !! input -{{ns:3}} +{{ROOTPAGENAMEE}} !! result -

    Benutzer Diskussion +

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end - !! test -Urlencode +Magic Word: {{BASEPAGENAME}} +!! options +title=[[Ævar Arnfjörð Bjarmason/sub]] subpage !! input -{{urlencode:hi world?!}} -{{urlencode:hi world?!|WIKI}} -{{urlencode:hi world?!|PATH}} -{{urlencode:hi world?!|QUERY}} +{{BASEPAGENAME}} !! result -

    hi+world%3F%21 -hi_world%3F! -hi%20world%3F%21 -hi+world%3F%21 +

    Ævar Arnfjörð Bjarmason

    !! end -### -### Magic links -### !! test -Magic links: internal link to RFC (bug 479) +Magic Word: {{BASEPAGENAMEE}} +!! options +title=[[Ævar Arnfjörð Bjarmason/sub]] subpage !! input -[[RFC 123]] +{{BASEPAGENAMEE}} !! result -

    RFC 123 +

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end !! test -Magic links: RFC (bug 479) +Magic Word: {{TALKPAGENAME}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -RFC 822 +{{TALKPAGENAME}} !! result -

    RFC 822 +

    User talk:Ævar Arnfjörð Bjarmason

    !! end !! test -Magic links: ISBN (bug 1937) +Magic Word: {{TALKPAGENAMEE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -ISBN 0-306-40615-2 +{{TALKPAGENAMEE}} !! result -

    ISBN 0-306-40615-2 +

    User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end !! test -Magic links: PMID incorrectly converts space to underscore +Magic Word: {{SUBJECTPAGENAME}} +!! options +title=[[User talk:Ævar Arnfjörð Bjarmason]] !! input -PMID 1234 +{{SUBJECTPAGENAME}} !! result -

    PMID 1234 +

    User:Ævar Arnfjörð Bjarmason

    !! end -### -### Templates -#### - !! test -Nonexistent template +Magic Word: {{SUBJECTPAGENAMEE}} +!! options +title=[[User talk:Ævar Arnfjörð Bjarmason]] !! input -{{thistemplatedoesnotexist}} +{{SUBJECTPAGENAMEE}} !! result -

    Template:Thistemplatedoesnotexist +

    User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end !! test -Template with invalid target containing tags +Magic Word: {{NUMBEROFFILES}} !! input -{{ab|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} +{{NUMBEROFFILES}} !! result -

    {{ab|foo|a=b|a = b}} +

    4

    !! end !! test -Template with invalid target containing unclosed tag +Magic Word: {{PAGENAME}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{a|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} +{{PAGENAME}} !! result -

    {{a|foo|a=b|a = b}} +

    Ævar Arnfjörð Bjarmason

    !! end -!! article -Template:test -!! text -This is a test template -!! endarticle - !! test -Simple template +Magic Word: {{PAGENAME}} with metacharacters +!! options +title=[['foo & bar = baz']] !! input -{{test}} +''{{PAGENAME}}'' !! result -

    This is a test template +

    'foo & bar = baz'

    !! end !! test -Template with explicit namespace +Magic Word: {{PAGENAME}} with metacharacters (bug 26781) +!! options +title=[[*RFC 1234 http://example.com/]] !! input -{{Template:test}} +{{PAGENAME}} !! result -

    This is a test template +

    *RFC 1234 http://example.com/

    !! end - -!! article -Template:paramtest -!! text -This is a test template with parameter {{{param}}} -!! endarticle - !! test -Template parameter +Magic Word: {{PAGENAMEE}} +!! options +title=[[User:Ævar Arnfjörð Bjarmason]] !! input -{{paramtest|param=foo}} +{{PAGENAMEE}} !! result -

    This is a test template with parameter foo +

    %C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason

    !! end -!! article -Template:paramtestnum -!! text -[[{{{1}}}|{{{2}}}]] -!! endarticle - !! test -Template unnamed parameter +Magic Word: {{PAGENAMEE}} with metacharacters (bug 26781) +!! options +title=[[*RFC 1234 http://example.com/]] !! input -{{paramtestnum|Main Page|the main page}} +{{PAGENAMEE}} !! result -

    the main page +

    *RFC_1234_http://example.com/

    !! end -!! article -Template:templatesimple -!! text -(test) -!! endarticle - -!! article -Template:templateredirect -!! text -#redirect [[Template:templatesimple]] -!! endarticle - -!! article -Template:templateasargtestnum -!! text -{{{{{1}}}}} -!! endarticle - -!! article -Template:templateasargtest -!! text -{{template{{{templ}}}}} -!! endarticle - -!! article -Template:templateasargtest2 -!! text -{{{{{templ}}}}} -!! endarticle - !! test -Template with template name as unnamed argument +Magic Word: {{REVISIONID}} !! input -{{templateasargtestnum|templatesimple}} +{{REVISIONID}} !! result -

    (test) +

    1337

    !! end !! test -Template with template name as argument +Magic Word: {{SCRIPTPATH}} !! input -{{templateasargtest|templ=simple}} +{{SCRIPTPATH}} !! result -

    (test) +

    /

    !! end !! test -Template with template name as argument (2) +Magic Word: {{STYLEPATH}} !! input -{{templateasargtest2|templ=templatesimple}} +{{STYLEPATH}} !! result -

    (test) +

    /skins

    !! end -!! article -Template:templateasargtestdefault -!! text -{{{{{templ|templatesimple}}}}} -!! endarticle - -!! article -Template:templa -!! text -'''templ''' -!! endarticle - !! test -Template with default value +Magic Word: {{SERVER}} !! input -{{templateasargtestdefault}} +{{SERVER}} !! result -

    (test) +

    http://example.org

    !! end !! test -Template with default value (value set) +Magic Word: {{SERVERNAME}} !! input -{{templateasargtestdefault|templ=templa}} +{{SERVERNAME}} !! result -

    templ +

    example.org

    !! end !! test -Template redirect +Magic Word: {{SITENAME}} !! input -{{templateredirect}} +{{SITENAME}} !! result -

    (test) +

    MediaWiki

    !! end !! test -Template with argument in separate line +Case-sensitive magic words, when cased differently, should just be template transclusions !! input -{{ templateasargtest | - templ = simple }} +{{CurrentMonth}} +{{currentday}} +{{cURreNTweEK}} +{{currentHour}} !! result -

    (test) +

    Template:CurrentMonth +Template:Currentday +Template:CURreNTweEK +Template:CurrentHour

    !! end !! test -Template with complex template as argument +Case-insensitive magic words should still work with weird casing. !! input -{{paramtest| - param ={{ templateasargtest | - templ = simple }}}} +{{sErVeRNaMe}} +{{LCFirst:AOEU}} +{{ucFIRST:aoeu}} +{{SERver}} !! result -

    This is a test template with parameter (test) +

    example.org +aOEU +Aoeu +http://example.org

    !! end !! test -Template with thumb image (with link in description) +Namespace 1 {{ns:1}} !! input -{{paramtest| - param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} +{{ns:1}} !! result -This is a test template with parameter - +

    Talk +

    !! end -!! article -Template:complextemplate -!! text -{{{1}}} {{paramtest| - param ={{{param}}}}} -!! endarticle - !! test -Template with complex arguments +Namespace 1 {{ns:01}} !! input -{{complextemplate| - param ={{ templateasargtest | - templ = simple }}|[[Template:complextemplate|link]]}} +{{ns:01}} !! result -

    link This is a test template with parameter (test) +

    Talk

    !! end !! test -BUG 553: link with two variables in a piped link +Namespace 0 {{ns:0}} (bug 4783) !! input -{| -|[[{{{1}}}|{{{2}}}]] -|} +{{ns:0}} !! result - - -
    [[{{{1}}}|{{{2}}}]] -
    !! end !! test -Magic variable as template parameter +Namespace 0 {{ns:00}} (bug 4783) !! input -{{paramtest|param={{SITENAME}}}} +{{ns:00}} !! result -

    This is a test template with parameter MediaWiki -

    -!! end -!! article -Template:linktest -!! text -[[{{{param}}}|link]] -!! endarticle +!! end !! test -Template parameter as link source +Namespace -1 {{ns:-1}} !! input -{{linktest|param=Main Page}} +{{ns:-1}} !! result -

    link +

    Special

    !! end -!!test -Template-generated attribute string (k='v') -!!input -bar -!!result -

    bar +!! test +Namespace User {{ns:User}} +!! input +{{ns:User}} +!! result +

    User

    -!!end - -!!article -Template:paramtest2 -!! text -including another template, {{paramtest|param={{{arg}}}}} -!! endarticle +!! end !! test -Template passing argument to another template +Namespace User talk {{ns:User_talk}} !! input -{{paramtest2|arg='hmm'}} +{{ns:User_talk}} !! result -

    including another template, This is a test template with parameter 'hmm' +

    User talk

    !! end -!! article -Template:Linktest2 -!! text -Main Page -!! endarticle - !! test -Template as link source +Namespace User talk {{ns:uSeR tAlK}} !! input -[[{{linktest2}}]] - -[[{{linktest2}}|Main Page]] - -[[{{linktest2}}]]Page +{{ns:uSeR tAlK}} !! result -

    Main Page -

    Main Page -

    Main PagePage +

    User talk

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

    File +

    +!! end -!! article -Template:loop1 -!! text -{{loop2}} -!! endarticle - -!! article -Template:loop2 -!! text -{{loop1}} -!! endarticle +!! test +Namespace File {{ns:Image}} +!! input +{{ns:Image}} +!! result +

    File +

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

    Template loop detected: Template:Loop1 +

    Benutzer

    !! end !! test -Template from main namespace +Namespace (lang=de) Benutzer Diskussion {{ns:3}} +!! options +language=de !! input -{{:Main Page}} +{{ns:3}} !! result -

    blah blah +

    Benutzer Diskussion

    !! end -!! article -Template:table -!! text -{| -| 1 || 2 -|- -| 3 || 4 -|} -!! endarticle !! test -BUG 529: Template with table, not included at beginning of line +Urlencode !! input -foo {{table}} +{{urlencode:hi world?!}} +{{urlencode:hi world?!|WIKI}} +{{urlencode:hi world?!|PATH}} +{{urlencode:hi world?!|QUERY}} !! result -

    foo +

    hi+world%3F%21 +hi_world%3F! +hi%20world%3F%21 +hi+world%3F%21

    - - - - - - -
    1 2 -
    3 4 -
    +!! end +### +### Magic links +### +!! test +Magic links: internal link to RFC (bug 479) +!! input +[[RFC 123]] +!! result +

    RFC 123 +

    !! end !! test -BUG 523: Template shouldn't eat newline (or add an extra one before table) +Magic links: RFC (bug 479) !! input -foo -{{table}} +RFC 822 !! result -

    foo +

    RFC 822

    - - - - - - -
    1 2 -
    3 4 -
    +!! end +!! test +Magic links: ISBN (bug 1937) +!! input +ISBN 0-306-40615-2 +!! result +

    ISBN 0-306-40615-2 +

    !! end !! test -BUG 41: Template parameters shown as broken links +Magic links: PMID incorrectly converts space to underscore !! input -{{{parameter}}} +PMID 1234 !! result -

    {{{parameter}}} +

    PMID 1234

    !! end +### +### Templates +#### + !! test -Template with targets containing wikilinks +Nonexistent template !! input -{{[[foo]]}} +{{thistemplatedoesnotexist}} +!! result +

    Template:Thistemplatedoesnotexist +

    +!! end -{{[[{{echo|foo}}]]}} +!! test +Template with invalid target containing tags +!! input +{{ab|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} +!! result +

    {{ab|foo|a=b|a = b}} +

    +!! end -{{{{echo|[[foo}}]]}} +!! test +Template with invalid target containing unclosed tag +!! input +{{a|{{echo|foo}}|{{echo|a}}={{echo|b}}|a = b}} !! result -

    {{foo}} -

    {{foo}} -

    {{[[foo}}]] +

    {{a|foo|a=b|a = b}}

    !! end !! article -Template:MSGNW test +Template:test !! text -''None'' of '''this''' should be -* interpreted - but rather passed unmodified -{{test}} +This is a test template !! endarticle -# hmm, fix this or just deprecate msgnw and document its behavior? !! test -msgnw keyword -!! options -disabled +Simple template !! input -{{msgnw:MSGNW test}} -!! result -

    ''None'' of '''this''' should be -* interpreted - but rather passed unmodified {{test}} +!! result +

    This is a test template

    !! end !! test -int keyword +Template with explicit namespace !! input -{{int:youhavenewmessages|lots of money|not!}} +{{Template:test}} !! result -

    You have lots of money (not!). +

    This is a test template

    !! end + !! article -Template:Includes +Template:paramtest !! text -Foozarbar +This is a test template with parameter {{{param}}} !! endarticle !! test - and being included +Template parameter !! input -{{Includes}} +{{paramtest|param=foo}} !! result -

    Foobar +

    This is a test template with parameter foo

    !! end !! article -Template:Includes2 +Template:paramtestnum !! text -Foobar +[[{{{1}}}|{{{2}}}]] !! endarticle !! test - being included +Template unnamed parameter !! input -{{Includes2}} +{{paramtestnum|Main Page|the main page}} !! result -

    Foo +

    the main page

    !! end +!! article +Template:templatesimple +!! text +(test) +!! endarticle + +!! article +Template:templateredirect +!! text +#redirect [[Template:templatesimple]] +!! endarticle !! article -Template:Includes3 +Template:templateasargtestnum !! text -Foobarzar +{{{{{1}}}}} +!! endarticle + +!! article +Template:templateasargtest +!! text +{{template{{{templ}}}}} +!! endarticle + +!! article +Template:templateasargtest2 +!! text +{{{{{templ}}}}} !! endarticle !! test - and being included +Template with template name as unnamed argument !! input -{{Includes3}} +{{templateasargtestnum|templatesimple}} !! result -

    Foo +

    (test)

    !! end !! test - and on a page +Template with template name as argument !! input -Foozarbar +{{templateasargtest|templ=simple}} !! result -

    Foozar +

    (test)

    !! end !! test -Un-closed +Template with template name as argument (2) !! input - +{{templateasargtest2|templ=templatesimple}} !! result +

    (test) +

    !! end +!! article +Template:templateasargtestdefault +!! text +{{{{{templ|templatesimple}}}}} +!! endarticle + +!! article +Template:templa +!! text +'''templ''' +!! endarticle + !! test - on a page +Template with default value !! input -Foobar +{{templateasargtestdefault}} !! result -

    Foobar +

    (test)

    !! end !! test -Un-closed +Template with default value (value set) !! input - +{{templateasargtestdefault|templ=templa}} !! result +

    templ +

    !! end -!!test -Self-closed noinclude, includeonly, onlyinclude tags -!!input - - - -!!result -


    +!! test +Template redirect +!! input +{{templateredirect}} +!! result +

    (test)

    -!!end - -!!test -Unbalanced includeonly and noinclude tags -!!input -{| -|a
    -|b
    -|c
    -|d
    -|} -!!result - - - - - -
    a -b -c</includeonly> -d</includeonly></includeonly> -
    - -!!end - -!! article -Template:Includeonly section -!! text - -==Includeonly section== - -==Section T-1== -!!endarticle +!! end !! test -Bug 6563: Edit link generation for section shown by +Template with argument in separate line !! input -{{includeonly section}} +{{ templateasargtest | + templ = simple }} !! result -

    [edit] Includeonly section

    -

    [edit] Section T-1

    - +

    (test) +

    !! end -# Uses same input as the contents of [[Template:Includeonly section]] !! test -Bug 6563: Section extraction for section shown by -!! options -section=T-2 +Template with complex template as argument !! input - -==Includeonly section== - -==Section T-2== +{{paramtest| + param ={{ templateasargtest | + templ = simple }}}} !! result -==Section T-2== +

    This is a test template with parameter (test) +

    !! end !! test -Bug 6563: Edit link generation for section suppressed by +Template with thumb image (with link in description) !! input - -==Includeonly section== - -==Section 1== +{{paramtest| + param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} !! result -

    [edit] Section 1

    +This is a test template with parameter !! end +!! article +Template:complextemplate +!! text +{{{1}}} {{paramtest| + param ={{{param}}}}} +!! endarticle + !! test -Bug 6563: Section extraction for section suppressed by -!! options -section=1 +Template with complex arguments !! input - -==Includeonly section== - -==Section 1== +{{complextemplate| + param ={{ templateasargtest | + templ = simple }}|[[Template:complextemplate|link]]}} !! result -==Section 1== +

    link This is a test template with parameter (test) +

    !! end !! test -Un-closed +BUG 553: link with two variables in a piped link !! input - +{| +|[[{{{1}}}|{{{2}}}]] +|} !! result + + +
    [[{{{1}}}|{{{2}}}]] +
    + !! end -### -### and in attributes -### -!!test -0. includeonly around the entire attribute -!!input -id="v1"id="v2">bar -!!result -

    bar +!! test +Magic variable as template parameter +!! input +{{paramtest|param={{SITENAME}}}} +!! result +

    This is a test template with parameter MediaWiki

    -!!end +!! end -!!test -1. includeonly in html attr key -!!input -idabout="foo">bar -!!result -

    bar +!! article +Template:linktest +!! text +[[{{{param}}}|link]] +!! endarticle + +!! test +Template parameter as link source +!! input +{{linktest|param=Main Page}} +!! result +

    link

    -!!end +!! end !!test -2. includeonly in html attr value +Template-generated attribute string (k='v') !!input -bar -"v1""v2">bar +bar !!result

    bar -bar

    !!end -!!test -3. includeonly in part of an attr value -!!input -bar -!!result -

    bar -

    -!!end +!!article +Template:paramtest2 +!! text +including another template, {{paramtest|param={{{arg}}}}} +!! endarticle -### -### Testing parsing of templates where a template arg -### has the same name as the template itself. -### +!! test +Template passing argument to another template +!! input +{{paramtest2|arg='hmm'}} +!! result +

    including another template, This is a test template with parameter 'hmm' +

    +!! end !! article -Template:quote +Template:Linktest2 !! text -{{{quote|{{{1}}}}}} +Main Page !! endarticle -!!test -Templates: Template Name/Arg clash: 1. Use of positional param -!!input -{{quote|foo}} -!!result -

    foo -

    -!!end +!! test +Template as link source +!! input +[[{{linktest2}}]] -!!test -Templates: Template Name/Arg clash: 2. Use of named param -!!input -{{quote|quote=foo}} -!!result -

    foo -

    -!!end +[[{{linktest2}}|Main Page]] -!!test -Templates: Template Name/Arg clash: 3. Use of named param with empty input -!!input -{{quote|quote}} -!!result -

    quote +[[{{linktest2}}]]Page +!! result +

    Main Page +

    Main Page +

    Main PagePage

    -!!end +!! end -### -### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged -### -!!test -Templates: 1. Simple use -!!input -{{echo|Foo}} -!!result -

    Foo -

    -!!end - -!!test -Templates: 2. Inside a block tag -!!input -
    {{echo|Foo}}
    -!!result -
    Foo
    +!! article +Template:loop1 +!! text +{{loop2}} +!! endarticle -!!end +!! article +Template:loop2 +!! text +{{loop1}} +!! endarticle -!!test -Templates: P-wrapping: 1a. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}} -!!result -

    Foo -bar +!! test +Template infinite loop +!! input +{{loop1}} +!! result +

    Template loop detected: Template:Loop1

    -!!end - -!!test -Templates: P-wrapping: 1b. Templates on consecutive lines -!!input -Foo +!! end -{{echo|bar}} -{{echo|baz}} -!!result -

    Foo -

    bar -baz +!! test +Template from main namespace +!! input +{{:Main Page}} +!! result +

    blah blah

    -!!end +!! end -!!test -Templates: P-wrapping: 1c. Templates on consecutive lines -!!input -{{echo|Foo}} -{{echo|bar}}
    baz
    -!!result -

    Foo +!! article +Template:table +!! text +{| +| 1 || 2 +|- +| 3 || 4 +|} +!! endarticle + +!! test +BUG 529: Template with table, not included at beginning of line +!! input +foo {{table}} +!! result +

    foo

    -bar
    baz
    + + + + + + +
    1 2 +
    3 4 +
    -!!end +!! end -!!test -Templates: Inline Text: 1. Multiple tmeplate uses -!!input -{{echo|Foo}}bar{{echo|baz}} -!!result -

    Foobarbaz +!! test +BUG 523: Template shouldn't eat newline (or add an extra one before table) +!! input +foo +{{table}} +!! result +

    foo

    -!!end + + + + + + +
    1 2 +
    3 4 +
    -!!test -Templates: Inline Text: 2. Back-to-back template uses -!!input -{{echo|Foo}}{{echo|bar}} -!!result -

    Foobar +!! end + +!! test +BUG 41: Template parameters shown as broken links +!! input +{{{parameter}}} +!! result +

    {{{parameter}}}

    -!!end +!! end -!!test -Templates: Block Tags: 1. Multiple template uses -!!input -{{echo|
    Foo
    }}
    bar
    {{echo|
    baz
    }} -!!result -
    Foo
    bar
    baz
    +!! test +Template with targets containing wikilinks +!! input +{{[[foo]]}} -!!end +{{[[{{echo|foo}}]]}} -!!test -Templates: Block Tags: 2. Back-to-back template uses -!!input -{{echo|
    Foo
    }}{{echo|
    bar
    }} -!!result -
    Foo
    bar
    +{{{{echo|[[foo}}]]}} +!! result +

    {{foo}} +

    {{foo}} +

    {{[[foo}}]] +

    +!! end -!!end +!! article +Template:MSGNW test +!! text +''None'' of '''this''' should be +* interpreted + but rather passed unmodified +{{test}} +!! endarticle -!!test -Templates: Links: 1. Simple example -!!input -{{echo|[[Foo|bar]]}} -!!result -

    bar +# hmm, fix this or just deprecate msgnw and document its behavior? +!! test +msgnw keyword +!! options +disabled +!! input +{{msgnw:MSGNW test}} +!! result +

    ''None'' of '''this''' should be +* interpreted + but rather passed unmodified +{{test}}

    -!!end +!! end -!!test -Templates: Links: 2. Generation of link href -!!input -[[{{echo|Foo}}|bar]] -!!result -

    bar +!! test +int keyword +!! input +{{int:youhavenewmessages|lots of money|not!}} +!! result +

    You have lots of money (not!).

    -!!end - -!!test -Templates: Links: 3. Generation of part of a link href -!!input -[[Fo{{echo|o}}|bar]] - -[[Foo{{echo|bar}}]] +!! end -[[Foo{{echo|bar}}baz]] +!! article +Template:Includes +!! text +Foozarbar +!! endarticle -[[Foo{{echo|bar}}|bar]] +!! test + and being included +!! input +{{Includes}} +!! result +

    Foobar +

    +!! end -[[:Foo{{echo|bar}}]] +!! article +Template:Includes2 +!! text +Foobar +!! endarticle -[[:Foo{{echo|bar}}|bar]] -!!result -

    bar -

    Foobar -

    Foobarbaz -

    bar -

    Foobar -

    bar +!! test + being included +!! input +{{Includes2}} +!! result +

    Foo

    -!!end +!! end -!!test -Templates: Links: 4. Multiple templates generating link href -!!input -[[{{echo|F}}{{echo|o}}ob{{echo|ar}}]] -!!result -

    Foobar -

    -!!end -!!test -Templates: Links: 5. Generation of link text -!!input -[[Foo|{{echo|bar}}]] -!!result -

    bar +!! article +Template:Includes3 +!! text +Foobarzar +!! endarticle + +!! test + and being included +!! input +{{Includes3}} +!! result +

    Foo

    -!!end +!! end + +!! test + and on a page +!! input +Foozarbar +!! result +

    Foozar +

    +!! end + +!! test +Un-closed +!! input + +!! result +!! end + +!! test + on a page +!! input +Foobar +!! result +

    Foobar +

    +!! end + +!! test +Un-closed +!! input + +!! result +!! end !!test -Templates: Links: 5. Nested templates (only outermost template should be marked) +Self-closed noinclude, includeonly, onlyinclude tags !!input -{{echo|[[{{echo|Foo}}|bar]]}} + + + !!result -

    bar +


    !!end !!test -Templates: HTML Tag: 1. Generation of HTML attr. key +Unbalanced includeonly and noinclude tags !!input -
    foo
    +{| +|a
    +|b
    +|c
    +|d
    +|} !!result -
    foo
    + + + + + +
    a +b +c</includeonly> +d</includeonly></includeonly> +
    !!end -!!test -Templates: HTML Tag: 2. Generation of HTML attr. value -!!input -
    foo
    -!!result -
    foo
    +!! 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 +

    Includeonly section[edit]

    +

    Section T-1[edit]

    + +!! 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 +

    Section 1[edit]

    + +!! end + +!! test +Bug 6563: Section extraction for section suppressed by +!! options +section=1 +!! input + +==Includeonly section== + +==Section 1== +!! result +==Section 1== +!! end + +!! test +Un-closed +!! input + +!! result +!! end + +# TODO: test with DOM fragment reuse! +!! test +Parsoid: DOM fragment reuse +!! options +parsoid=wt2wt,wt2html +!! input +a{{echo|b
    c}}d + +a{{echo|b +
    +c}}d + +{{echo|a + +
    + +b}} +!! result +ab +
    cd + + +

    ab

    + +
    + +

    cd

    -!!end +

    a

    + + +
    + + +

    b

    +!! end + +!! test +Parsoid: Merge double tds (bug 50603) +!! options +parsoid +!! input +{| +|{{echo|{{!}} foo}} +|} +!! result + + +
    foo
    +!! end + +!! test +Parsoid: Merge double tds in nested transclusion content (bug 50603) +!! options +parsoid +!! input +{{echo|
    }} +{| +|{{echo|{{!}} foo}} +|} +{{echo|
    }} +!! result +
    + + +
    foo
    +
    +!! end + +### +### and in attributes +### !!test -Templates: HTML Tag: 3. Generation of HTML attr key and value +0. includeonly around the entire attribute !!input -
    foo
    +id="v1"
    id="v2">bar !!result -
    foo
    - +

    bar +

    !!end !!test -Templates: HTML Tag: 4. Generation of starting piece of HTML attr value +1. includeonly in html attr key !!input -
    foo
    +idabout="foo">bar !!result -
    foo
    - +

    bar +

    !!end !!test -Templates: HTML Tag: 5. Generation of middle piece of HTML attr value +2. includeonly in html attr value !!input -
    foo
    +bar +"v1""v2">bar !!result -
    foo
    - +

    bar +bar +

    !!end !!test -Templates: HTML Tag: 6. Generation of end piece of HTML attr value +3. includeonly in part of an attr value !!input -
    foo
    +bar !!result -
    foo
    - +

    bar +

    !!end +### +### Testing parsing of templates where a template arg +### has the same name as the template itself. +### + +!! article +Template:quote +!! text +{{{quote|{{{1}}}}}} +!! endarticle + !!test -Templates: HTML Tables: 1. Generating start of a HTML table +Templates: Template Name/Arg clash: 1. Use of positional param !!input -{{echo|}}
    foo
    +{{quote|foo}} !!result -
    foo
    - +

    foo +

    !!end !!test -Templates: HTML Tables: 2a. Generating middle of a HTML table +Templates: Template Name/Arg clash: 2. Use of named param !!input -{{echo|}}
    foo
    +{{quote|quote=foo}} !!result -
    foo
    - +

    foo +

    !!end !!test -Templates: HTML Tables: 2b. Generating middle of a HTML table +Templates: Template Name/Arg clash: 3. Use of named param with empty input !!input -{{echo|}}
    foo
    +{{quote|quote}} !!result -
    foo
    - +

    quote +

    !!end +### +### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged +### + !!test -Templates: HTML Tables: 3. Generating end of a HTML table +Templates: 1. Simple use !!input -{{echo|
    foo
    }} +{{echo|Foo}} !!result -
    foo
    - +

    Foo +

    !!end !!test -Templates: HTML Tables: 4a. Generating a single tag of a HTML table +Templates: 2. Inside a block tag !!input -{{echo|}}
    foo
    +
    {{echo|Foo}}
    +
    {{echo|Foo}}
    !!result -
    foo
    +
    Foo
    +
    Foo
    !!end !!test -Templates: HTML Tables: 4b. Generating a single tag of a HTML table +Templates: P-wrapping: 1a. Templates on consecutive lines !!input -{{echo|}}
    foo
    +{{echo|Foo}} +{{echo|bar}} !!result -
    foo
    +

    Foo +bar +

    +!!end + +!!test +Templates: P-wrapping: 1b. Templates on consecutive lines +!!input +Foo +{{echo|bar}} +{{echo|baz}} +!!result +

    Foo +

    bar +baz +

    !!end !!test -Templates: HTML Tables: 4c. Generating a single tag of a HTML table +Templates: P-wrapping: 1c. Templates on consecutive lines !!input -{{echo|
    }}foo
    +{{echo|Foo}} +{{echo|bar}}
    baz
    !!result -
    foo
    +

    Foo +

    +bar
    baz
    !!end !!test -Templates: HTML Tables: 4d. Generating a single tag of a HTML table +Templates: P-wrapping: 1d. Template preceded by comment-only line +!!options +parsoid !!input -}}
    foo{{echo|
    + +{{echo|Bar}} !!result -
    foo
    + +

    Bar

    !!end !!test -Templates: HTML Tables: 4e. Generating a single tag of a HTML table +Templates: Inline Text: 1. Multiple tmeplate uses !!input -{{echo|}}
    foo
    +{{echo|Foo}}bar{{echo|baz}} !!result -
    foo
    +

    Foobarbaz +

    +!!end +!!test +Templates: Inline Text: 2. Back-to-back template uses +!!input +{{echo|Foo}}{{echo|bar}} +!!result +

    Foobar +

    !!end !!test -Templates: HTML Tables: 4f. Generating a single tag of a HTML table +Templates: Block Tags: 1. Multiple template uses !!input -{{echo|
    foo
    }} +{{echo|
    Foo
    }}
    bar
    {{echo|
    baz
    }} !!result -
    foo
    +
    Foo
    bar
    baz
    !!end !!test -Templates: Wiki Tables: 1a. Fostering of entire template content +Templates: Block Tags: 2. Back-to-back template uses !!input -{| -{{echo|a}} -|} +{{echo|
    Foo
    }}{{echo|
    bar
    }} !!result - -a -
    +
    Foo
    bar
    !!end !!test -Templates: Wiki Tables: 1b. Fostering of entire template content +Templates: Links: 1. Simple example !!input -{| -{{echo|
    }} -foo -{{echo|
    }} -|} +{{echo|[[Foo|bar]]}} !!result - -
    -

    foo +

    bar

    -
    -
    +!!end +!!test +Templates: Links: 2. Generation of link href +!!input +[[{{echo|Foo}}|bar]] +!!result +

    bar +

    !!end !!test -Templates: Wiki Tables: 2. Fostering of partial template content +Templates: Links: 3. Generation of part of a link href !!input -{| -{{echo|a -
    b
    }} -|} +[[Fo{{echo|o}}|bar]] + +[[Foo{{echo|bar}}]] + +[[Foo{{echo|bar}}baz]] + +[[Foo{{echo|bar}}|bar]] + +[[:Foo{{echo|bar}}]] + +[[:Foo{{echo|bar}}|bar]] !!result - -a -
    b
    -
    +

    bar +

    Foobar +

    Foobarbaz +

    bar +

    Foobar +

    bar +

    +!!end +!!test +Templates: Links: 4. Multiple templates generating link href +!!input +[[{{echo|F}}{{echo|o}}ob{{echo|ar}}]] +!!result +

    Foobar +

    !!end !!test -Templates: Wiki Tables: 3. td-content via multiple templates +Templates: Links: 5. Generation of link text !!input -{| -{{echo|{{pipe}}a}}{{echo|b}} -|} +[[Foo|{{echo|bar}}]] !!result - - -
    ab -
    +

    bar +

    +!!end +!!test +Templates: Links: 5. Nested templates (only outermost template should be marked) +!!input +{{echo|[[{{echo|Foo}}|bar]]}} +!!result +

    bar +

    !!end !!test -Templates: Wiki Tables: 4. Templated tags, no content +Templates: HTML Tag: 1. Generation of HTML attr. key !!input -{{tbl-start}} -{{tbl-end}} +
    foo
    !!result - -
    +
    foo
    !!end !!test -Templates: Wiki Tables: 5. Templated tags, regular td-tags +Templates: HTML Tag: 2. Generation of HTML attr. value !!input -{{tbl-start}} -|foo -{{tbl-end}} +
    foo
    !!result - - -
    foo -
    +
    foo
    !!end !!test -Templates: Wiki Tables: 6. Templated tags, templated td-tags +Templates: HTML Tag: 3. Generation of HTML attr key and value !!input -{{tbl-start}} -{{!}}foo -{{tbl-end}} +
    foo
    !!result - - -
    foo -
    +
    foo
    !!end !!test -Templates: Lists: Multi-line list-items via templates +Templates: HTML Tag: 4. Generation of starting piece of HTML attr value !!input -*{{echo|a {{nonexistent| -unused}}}} -*{{echo|b {{nonexistent| -unused}}}} +
    foo
    !!result - +
    foo
    !!end !!test -Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo) +Templates: HTML Tag: 5. Generation of middle piece of HTML attr value !!input -{{echo|''a}}{{echo|b''c''d}}{{echo|''e}} +
    foo
    !!result -

    abcde -

    +
    foo
    + !!end !!test -Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) -(PHP parser generates misnested html) -!! options -disabled +Templates: HTML Tag: 6. Generation of end piece of HTML attr value !!input -{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} +
    foo
    !!result -

    abcde

    +
    foo
    + !!end !!test -Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div) -(PHP parser generates misnested html) -!! options -disabled +Templates: HTML Tag: 7. Generation of partial attribute key string !!input -{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} +
    foo
    !!result -
    a
    -
    bcd
    -
    e
    +
    foo
    + !!end !!test -Templates: Ugly nesting: 4. Divs opened/closed across templates +Templates: HTML Tables: 1. Generating start of a HTML table !!input -a
    b{{echo|c
    d}}e +{{echo|}}
    foo
    !!result -a
    bc
    de +
    foo
    !!end !!test -Templates: Ugly templates: 1. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid +Templates: HTML Tables: 2a. Generating middle of a HTML table !!input -{| -|{{echo|foo}} -|bar -|} +{{echo|}}
    foo
    !!result - -
    foo
    -bar - +
    foo
    + !!end !!test -Templates: Ugly templates: 2. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options +Templates: HTML Tables: 2b. Generating middle of a HTML table +!!input +{{echo|}}
    foo
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 3. Generating end of a HTML table +!!input +{{echo|
    foo
    }} +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4a. Generating a single tag of a HTML table +!!input +{{echo|}}
    foo
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4b. Generating a single tag of a HTML table +!!input +{{echo|}}
    foo
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4c. Generating a single tag of a HTML table +!!input +{{echo|
    }}foo
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4d. Generating a single tag of a HTML table +!!input +}}
    foo{{echo|
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4e. Generating a single tag of a HTML table +!!input +{{echo|}}
    foo
    +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 4f. Generating a single tag of a HTML table +!!input +{{echo|
    foo
    }} +!!result +
    foo
    + +!!end + +!!test +Templates: HTML Tables: 5. Proper fostering of categories from inside +!!options +parsoid=wt2html,wt2wt +!!input +[[Category:foo1]]
    foo
    + +[[Category:bar1]][[Category:bar2]]
    foo
    +!!result +
    foo
    + +
    foo
    +!!end + +!!test +Templates: Wiki Tables: 1a. Fostering of entire template content +!!input +{| +{{echo|a}} +|} +!!result + +a +
    + +!!end + +!!test +Templates: Wiki Tables: 1b. Fostering of entire template content +!!input +{| +{{echo|
    }} +foo +{{echo|
    }} +|} +!!result + +
    +

    foo +

    +
    +
    + +!!end + +!!test +Templates: Wiki Tables: 2. Fostering of partial template content +!!input +{| +{{echo|a +
    b
    }} +|} +!!result + +a +
    b
    +
    + +!!end + +!!test +Templates: Wiki Tables: 3. td-content via multiple templates +!!input +{| +{{echo|{{pipe}}a}}{{echo|b}} +|} +!!result + + +
    ab +
    + +!!end + +!!test +Templates: Wiki Tables: 4. Templated tags, no content +!!input +{{tbl-start}} +{{tbl-end}} +!!result + +
    + +!!end + +!!test +Templates: Wiki Tables: 5. Templated tags, regular td-tags +!!input +{{tbl-start}} +|foo +{{tbl-end}} +!!result + + +
    foo +
    + +!!end + +!!test +Templates: Wiki Tables: 6. Templated tags, templated td-tags +!!input +{{tbl-start}} +{{!}}foo +{{tbl-end}} +!!result + + +
    foo +
    + +!!end + +!!test +Templates: Lists: Multi-line list-items via templates +!!input +*{{echo|a {{nonexistent| +unused}}}} +*{{echo|b {{nonexistent| +unused}}}} +!!result + + +!!end + +!!test +Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo) +!!input +{{echo|''a}}{{echo|b''c''d}}{{echo|''e}} +!!result +

    abcde +

    +!!end + +!!test +Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) +(PHP parser generates misnested html) +!! options +parsoid +!!input +{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} +!!result +

    abcde

    +!!end + +!!test +Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div) +(PHP parser generates misnested html; Parsoid html2wt mode adds newlines between {{echo}}s) +!! options +parsoid=wt2html,wt2wt +!!input +{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} +!!result +
    a
    +
    bcd
    +
    e
    +!!end + +!!test +Templates: Ugly nesting: 4. Divs opened/closed across templates +!!input +a
    b{{echo|c
    d}}e +!!result +a
    bc
    de + +!!end + +!!test +Templates: Ugly templates: 1. Navbox template parses badly leading to table misnesting +(Parsoid-centric) +!! options +parsoid +!!input +{| +|{{echo|foo}} +|bar +|} +!!result + + + + +
    foo
    +bar + +!!end + +!!test +Templates: Ugly templates: 2. Navbox template parses badly leading to table misnesting +(Parsoid-centric) +!! options parsoid !!input @@ -6058,24 +8487,24 @@ parsoid
    !!result - - - - -
    - - -
    1. foo
    bar 2. baz
    - - - abc - - - - - - xyz - + + + + +
    + + +
    1. foo
    bar 2. baz
    + + + abc + + + + + + xyz + !!end @@ -6237,10 +8666,13 @@ wikinowiki But just in case it doesn't... !! result -

    [edit] =

    +

    =[edit]

    The line above must have a trailing space!

    -

    [edit] =

    +

    =[edit]

    But just in case it doesn't...

    !! end @@ -7811,7 +10836,7 @@ section 5 !! result

    The tooltips shall not show entities to the user (ie. be double escaped)

    -

    Contents

    +

    Contents

    -
    -

    [edit] text > text

    +
  • + +

    text > text[edit]

    section 1

    -

    [edit] text < text

    +

    text < text[edit]

    section 2

    -

    [edit] text & text

    +

    text & text[edit]

    section 3

    -

    [edit] text ' text

    +

    text ' text[edit]

    section 4

    -

    [edit] text " text

    +

    text " text[edit]

    section 5

    !! end @@ -7846,18 +10872,59 @@ Headers with excess '=' characters =''italic'' heading== ==''italic'' heading= !! result -

    Contents

    +
    -

    [edit] foo=

    -

    [edit] =foo

    -

    [edit] italic heading=

    -

    [edit] =italic heading

    +
    + +

    foo=[edit]

    +

    =foo[edit]

    +

    italic heading=[edit]

    +

    =italic heading[edit]

    + +!! end + +!! test +HTML headers vs TOC (bug 23393) +(__NOEDITSECTION__ for clearer output, doesn't matter here) +!! input +

    Header 1

    +== Header 1.1 == +== Header 1.2 == + +

    Header 2 +

    +== Header 2.1 == +== Header 2.2 == +__NOEDITSECTION__ +!! result + + +

    Header 1

    +

    Header 1.1

    +

    Header 1.2

    +

    Header 2

    +

    Header 2.1

    +

    Header 2.2

    !! end @@ -7953,7 +11020,7 @@ div with illegal double attributes !! test div with empty attribute value, space before equals !! options -disabled +parsoid !! input
    HTML rocks
    !! result @@ -7966,7 +11033,7 @@ disabled !! test div with braces in attribute value !! options -disabled +parsoid !! input
    Foo
    !! result @@ -7983,7 +11050,7 @@ disabled !! test div with empty attribute value, no space before equals !! options -disabled +parsoid !! input
    HTML rocks
    !! result @@ -8078,6 +11145,81 @@ I always thought &xacute; was a cute letter. !! end +### +### Nesting tests (see bug 41545, 50604, 51081) +### + +# This test case is fixed in Parsoid by domino 1.0.12. (bug 50604) +# Note that html2wt is considerably more difficult if we use in +# the test case, instead of +!! test +Ensure that HTML adoption agency algorithm is properly implemented. +!! input +XYZ +!! result +

    XYZ +

    +!! end + +# This was bug 41545 in the PHP parser. +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + +# The following cases were bug 51081 in the PHP parser. +# Note that there are some other nestable tags (b, i, etc) which are +# not covered; see bug 51081 for discussion. +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + +!! test +Nesting of +!! input +XYZ +!! result +

    XYZ +

    +!! end + + ### ### Media links ### @@ -8470,70 +11612,6 @@ MSIE CSS safety test: comment in expression !! end -!! test -CSS safety test: vertical tab -!! input -

    A

    -!! result -

    A

    - -!! end - -!! test -MSIE CSS safety test: Fullwidth -!! input -

    A

    -
    B
    -!! result -

    A

    -
    B
    - -!! end - -!! test -MSIE CSS safety test: IPA extensions -!! input -
    A
    -

    B

    -!! result -
    A
    -

    B

    - -!! end - -!! test -MSIE CSS safety test: sup/sub script -!! input -
    A
    -
    B
    -

    C

    -!! result -
    A
    -
    B
    -

    C

    - -!! end - -!! test -MSIE CSS safety test: Repetition markers -!! input -

    A

    -

    B

    -

    C

    -

    D

    -

    E

    -

    F

    -

    G

    -!! result -

    A

    -

    B

    -

    C

    -

    D

    -

    E

    -

    F

    -

    G

    - -!! end !! test Table attribute legitimate extension @@ -8617,7 +11695,7 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check 2) !! end ### -### Parser hooks (see maintenance/parserTestsParserHook.php for the extension) +### Parser hooks (see tests/parser/parserTestsParserHook.php for the extension) ### !! test Parser hook: empty input @@ -8782,7 +11860,7 @@ array ( !! end ### -### (see maintenance/parserTestsStaticParserHook.php for the extension) +### (see tests/parser/parserTestsParserHook.php for the extension) ### !! test @@ -9014,11 +12092,13 @@ disabled !! result
    • One -
    • Two -
    - -!! end - + +
  • Two +
  • + + +!! end + !! test HTML ordered list, closed tags (bug 5497) !! input @@ -9046,8 +12126,10 @@ disabled !! result
    1. One -
    2. Two -
    + +
  • Two +
  • + !! end @@ -9092,12 +12174,16 @@ disabled !! result
    • One -
    • Two: +
    • +
    • Two:
      • Sub-one -
      • Sub-two -
      -
    + +
  • Sub-two +
  • + + + !! end @@ -9142,21 +12228,27 @@ disabled !! result
    1. One -
    2. Two: +
    3. +
    4. Two:
      1. Sub-one -
      2. Sub-two -
      -
    + +
  • Sub-two +
  • + + + !! end !! test HTML ordered list item with parameters oddity !! input -
    1. One
    +
    1. One
    2. +
    !! result -
    1. One
    +
    1. One
    2. +
    !! end @@ -9208,12 +12300,13 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! result -

    [edit] onmouseover=

    -http://

    Contents

    +

    onmouseover=[edit]

    +http://

    Contents

    -
    + + !! end @@ -9223,7 +12316,7 @@ Fuzz testing: Parser14-table ==a== {| STYLE=__TOC__ !! result -

    [edit] a

    +

    a[edit]

    @@ -9369,7 +12462,7 @@ Fuzz testing: image with bogus manual thumbnail !!input [[Image:foobar.jpg|thumbnail= ]] !!result -
    Error creating thumbnail:
    +
    Error creating thumbnail:
    !!end @@ -10380,17 +13473,33 @@ Handling of in URLs !! input **irc:// a !! result - + !!end !! test -5 quotes, code coverage +1 line +5 quotes, code coverage +1 line (php) +!! options +php +!! input +''''' +!! result +!! end +# The PHP parser strips the empty tags out for giggles; parsoid doesn't. +!! test +5 quotes, code coverage +1 line (parsoid) +!! options +parsoid !! input ''''' !! result +

    !! end !! test @@ -10404,43 +13513,78 @@ Special:Search page linking. !! test Say the magic word +!! options +title=[[Parser test]] !! input * {{PAGENAME}} +* {{PAGENAMEE}} +* {{FULLPAGENAME}} +* {{FULLPAGENAMEE}} * {{BASEPAGENAME}} +* {{BASEPAGENAMEE}} * {{SUBPAGENAME}} * {{SUBPAGENAMEE}} -* {{BASEPAGENAME}} -* {{BASEPAGENAMEE}} +* {{ROOTPAGENAME}} +* {{ROOTPAGENAMEE}} * {{TALKPAGENAME}} * {{TALKPAGENAMEE}} * {{SUBJECTPAGENAME}} * {{SUBJECTPAGENAMEE}} * {{NAMESPACEE}} * {{NAMESPACE}} +* {{NAMESPACENUMBER}} * {{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 -
    +
      +
    • Parser test +
    • +
    • Parser_test +
    • +
    • Parser test +
    • +
    • Parser_test +
    • +
    • Parser test +
    • +
    • Parser_test +
    • +
    • Parser test +
    • +
    • Parser_test +
    • +
    • Parser test +
    • +
    • Parser_test +
    • +
    • Talk:Parser test +
    • +
    • Talk:Parser_test +
    • +
    • Parser test +
    • +
    • Parser_test +
    • +
    • +
    • +
    • +
    • +
    • 0 +
    • +
    • Talk +
    • +
    • Talk +
    • +
    • +
    • +
    • +
    • +
    • Template:Dynamic +
    • +
    !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. @@ -10459,40 +13603,40 @@ image4 |300px| centre * image6 !! result -