X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=216d7e5d3c2df2abf1b87ec855ceb7b87fd0220e;hp=e67ad6665856ebeec7838bf4adff6afed44be833;hb=99e861920d9b1db2f834fb7b5055c75b8fcc720b;hpb=c97a962bdb54947affcbe6ca70787f42b23255e9 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e67ad66658..216d7e5d3c 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -62,6 +62,12 @@ Template:Foo FOO !!endarticle +!! article +Template:redirect to foo +!! text +#REDIRECT [[Template:Foo]] +!! endarticle + !! article Template:Blank !! text @@ -109,6 +115,14 @@ Template:echo {{{1}}} !! endarticle +!! article +Template:echo3 +!! text +{{{1}}} +{{{1}}} +{{{1}}} +!! endarticle + // For Serbian; localize Template namespace !! article Шаблон:Echo @@ -128,6 +142,12 @@ Template:echo_with_div
{{{1}}}
!! endarticle +!! article +Template:echo with depth +!! text +{{echo|{{{1}}}}} +!! endarticle + !! article Template:blank_param !! text @@ -1257,6 +1277,7 @@ Ruby markup (W3C-style) :東京(とうきょう) ;Double-sided ruby :旧金山jiùjīnshānSan Francisco + ♥HeartCœur ☘ShamrockTrèfle @@ -1824,6 +1845,39 @@ b

!! end +!! test +post-expand include size being exceeded +!! options +maxincludesize=20 +!! wikitext +{{echo3|1234567890}} +!! html +

Template:Echo3 +

+!! end + +!! test +max template depth being reached +!! options +maxtemplatedepth=1 +!! wikitext +{{echo with depth|too deep!}} +!! html +

Template recursion depth limit exceeded (1) +

+!! end + +!! test +multiple templates that are redirects +!! wikitext +{{redirect to foo}} +{{redirect to foo}} +!! html +

FOO +FOO +

+!! end + !! test Multiple comments should still parse as SOL-transparent !! options @@ -3869,6 +3923,7 @@ Definition and unordered list using wiki syntax nested in unordered list using h Definition list with empty definition and following paragraph !! wikitext ;term: + Paragraph text !! html
term
@@ -3957,6 +4012,29 @@ should be left alone

!! end +!! test +Definition Lists: Hacky use to indent tables (with content following table) +!! wikitext +:{| +|foo +|bar +|} this text should be part of the dl +!! html/php+tidy +
+ + +
foo +bar +
this text should be part of the dl
+!! html/parsoid +
+ + +
foo +bar +
this text should be part of the dl
+!! end + !! test Definition Lists: Hacky use to indent tables, with comments (T65979) !! wikitext @@ -4050,9 +4128,11 @@ Table / list interaction: indented table with lists in table contents :{| |- |a + *b |- |c + *d |} !! html @@ -5543,6 +5623,7 @@ IPv6 urls, autolink format (T23261) http://[2404:130:0:1000::187:2]/index.php Examples from RFC 2373, section 2.2: + *http://[1080::8:800:200C:417A]/unicast *http://[FF01::101]/multicast *http://[::1]/loopback @@ -5551,6 +5632,7 @@ Examples from RFC 2373, section 2.2: *http://[::FFFF:129.144.52.38]/ipv4compat Examples from RFC 2732, section 2: + *http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html *http://[1080:0:0:0:8:800:200C:417A]/index.html *http://[3ffe:2a00:100:7031::1] @@ -5558,7 +5640,6 @@ Examples from RFC 2732, section 2: *http://[::192.9.5.5]/ipng *http://[::FFFF:129.144.52.38]:80/index.html *http://[2010:836B:4179::836B:4179] - !! html/php

http://[2404:130:0:1000::187:2]/index.php

Examples from RFC 2373, section 2.2: @@ -5606,6 +5687,7 @@ IPv6 urls, bracketed format (T23261) [http://[2404:130:0:1000::187:2]/index.php test] Examples from RFC 2373, section 2.2: + *[http://[1080::8:800:200C:417A] unicast] *[http://[FF01::101] multicast] *[http://[::1]/ loopback] @@ -5614,6 +5696,7 @@ Examples from RFC 2373, section 2.2: *[http://[::FFFF:129.144.52.38] ipv4compat] Examples from RFC 2732, section 2: + *[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1] *[http://[1080:0:0:0:8:800:200C:417A]/index.html 2] *[http://[3ffe:2a00:100:7031::1] 3] @@ -5621,7 +5704,6 @@ Examples from RFC 2732, section 2: *[http://[::192.9.5.5]/ipng 5] *[http://[::FFFF:129.144.52.38]:80/index.html 6] *[http://[2010:836B:4179::836B:4179] 7] - !! html/php

test

Examples from RFC 2373, section 2.2: @@ -9229,6 +9311,7 @@ language=is Redirect syntax under text isn't considered a redirect !! wikitext some text + #redirect [[Main Page]] !! html/parsoid

some text

@@ -9502,6 +9585,7 @@ Numbered list !! end +# the switch from level 3 to ordered should not introduce a newline between !! test Mixed list !! wikitext @@ -9864,8 +9948,10 @@ parsoid !! wikitext #foo ##bar + *foo **bar + :foo ::bar !! html @@ -11471,6 +11557,17 @@ Template from main namespace

!! end +!! test +Template from non-includable namespace +!! options +wgNonincludableNamespaces=10 +!! wikitext +{{echo|uh oh!}} +!! html +

Template:Echo +

+!! end + !! article Template:table !! text @@ -16482,10 +16579,10 @@ parsoid=wt2html

Level 4 Heading

Level 5 Heading
Level 6 Heading
-
=Level 7 Heading=
-
==Level 8 Heading==
-
===Level 9 Heading===
-
====Level 10 Heading====
+
=Level 7 Heading=
+
==Level 8 Heading==
+
===Level 9 Heading===
+
====Level 10 Heading====
!! end !! test @@ -16967,7 +17064,8 @@ __NOEDITSECTION__

Header 1

Header 1.1

Header 1.2

-

Header 2

+

Header 2 +

Header 2.1

Header 2.2

@@ -18279,6 +18377,27 @@ this is a '''test'''

this is a test

!! end +!! test +Parser hook: horizontal rule inside extension tag that outputs
+!! wikitext
+
+Hello
+
+Goodbye +
+!! html/php +
+'
+Hello
+
+Goodbye +' +array ( +) +
+ +!! end + ### ### (see tests/parser/parserTestsParserHook.php for the extension) ### @@ -24754,6 +24873,7 @@ Empty LI and TR nodes should not be stripped from top-level content * a * * b + {| |- |- @@ -28749,7 +28869,7 @@ foo {{echo|bar [[Category:baz]]}} bar # of the categories in wikitext # Do not remove these characters in edits. # -# As part of the serialization, these bidi characters will get stripped. +# As part of the serialization, these Unicode directional formatting characters will get stripped. !! test RTL (\u200f) and LTR (\u200e) markers around category tags should be stripped !! options @@ -29423,6 +29543,64 @@ y }} !! end +!! test +New list is serialized on newlines +!! options +parsoid=html2wt +!! html/parsoid +

The quick brown fox jumps over the lazy dog.

    +
  • Yesterday
  • +
  • Today
  • +
  • Tomorrow
  • +

The quick onyx goblin jumps over the lazy dwarf.

+!! wikitext +The quick brown fox jumps over the lazy dog. + +* Yesterday +* Today +* Tomorrow + +The quick onyx goblin jumps over the lazy dwarf. +!! end + +!! test +New lists in formatting elements serialized w/o newlines +!! options +parsoid=html2wt +!! html/parsoid + + +
    +
  • 123
  • +
+ +
+ +
  • hi
+!! wikitext + +* 123 + + + +* hi + +!! end + +!! test +New list in table doesn't need newlines +!! options +parsoid=html2wt +!! html/parsoid +
  • test
  • 123
+!! wikitext +{| +| +* test +* 123 +|} +!! end + # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # --------------------------------------------------- @@ -30511,7 +30689,8 @@ headings, and cells. HTML versions of the same should preserve whitespace. Trim whitespace in wikitext headings, list items, table captions, headings, and cells !! wikitext __NOTOC__ -== Heading == +== Spaces == +== Tabs == * List item ; term : definition {| @@ -30529,7 +30708,8 @@ __NOTOC__ | Table Cell 1 || Table Cell 2 |} foo !! html/php+tidy -

Heading[edit]

+

Spaces[edit]

+

Tabs[edit]

  • List item
term 
definition
@@ -30563,20 +30743,19 @@ __NOTOC__ Do not trim whitespace in HTML headings, list items, table captions, headings, and cells !! wikitext __NOTOC__ -

Heading

+

Heading

  • List item
Table Heading
Table Cell
!! html/php+tidy -

Heading

+

Heading

  • List item
Table Heading
Table Cell
- !! end !! test @@ -30589,3 +30768,134 @@ foo '' italic '' and ''' bold ''' some text

!! end + +!! test +Remove p tags surrounding a single element in a figcaption +!! options +parsoid=html2wt +!! wikitext +[[File:Foobar.jpg|right|200x200px|Caption]] +!! html/parsoid +

Caption

+!! end + +!! test +Selser preserves lack of newline before list and allows newline after the list +!! options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "ul", "after", "

footer

" ] + ] +} +!! wikitext +header +*foo +*bar +!! wikitext/edited +header +*foo +*bar + +footer +!! end + + +!! test +Selser does not introduce newlines between unedited paragraph preceding the list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "table tbody tr td p:last-child", "empty" ] + ] +} +!! wikitext +{| +| +header +*foo +*bar +footer +|} +!! wikitext/edited +{| +| +header +*foo +*bar + +|} +!! end + +!! test +Selser does not introduce newlines between unedited paragraph following the list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "table tbody tr td p:first-child", "empty" ] + ] +} +!! wikitext +{| +| +header +*foo +*bar +footer +|} +!! wikitext/edited +{| +| + +*foo +*bar +footer +|} +!! end + +!! test +Remove a list item but do not insert newline above list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "ul li:last-child", "remove" ] + ] +} +!! wikitext +header +*foo +*bar +footer +!! wikitext/edited +header +*foo +footer +!! end + +!! test +Check soft hyphens as entities (­) in displaytitle (T66528) +!! options +showtitle +title=[[Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon]] +!! wikitext +{{DISPLAYTITLE:Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon}} +!! html/php +Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon + +!! end + +!! test +Check soft hyphens as Unicode characters (U+00AD) in displaytitle (T66528) +!! options +showtitle +title=[[Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon]] +!! wikitext +{{DISPLAYTITLE:Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon}} +!! html/php +Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon + +!! end