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
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 !! htmlfoo + | +bar + |
foo + | +bar + |
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
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 + +!! end + !! article Template:table !! text @@ -16482,10 +16579,10 @@ parsoid=wt2htmlthis is a test
!! end +!! test +Parser hook: horizontal rule inside extension tag that outputs+!! wikitext ++Hello + +!! html/php +
+Goodbye ++' +Hello ++ +!! end + ### ### (see tests/parser/parserTestsParserHook.php for the
+Goodbye +' +array ( +) +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
++!! wikitext + +* 123 + + + +* hi + +!! end + +!! test +New list in table doesn't need newlines +!! options +parsoid=html2wt +!! html/parsoid +
- hi
+!! 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 -
- test
- 123
Heading[edit]
+Spaces[edit]
+Tabs[edit]
- List item
@@ -30563,20 +30743,19 @@ __NOTOC__ Do not trim whitespace in HTML headings, list items, table captions, headings, and cells !! wikitext __NOTOC__ -
- term
- definition
Heading
+
Heading
- List item
!! html/php+tidy -
Table Heading Table Cell Heading
+
Heading
- List item
- !! 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 + +!! end + +!! test +Selser preserves lack of newline before list and allows newline after the list +!! options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "ul", "after", "
Table Heading Table Cell 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:Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon}} +!! html/php +Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon + +!! 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