X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=72ee550109ace80421838d2ffe2e96eb4086547a;hb=fd3773685b887dc2b4fa856907a9cf5229df74ac;hp=0aa0e033c40990ea38fa0f446c7505d1982b9d78;hpb=72bd7a4decb46653dc7acbf22ac01bceee275a4e;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 0aa0e033c4..72ee550109 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -546,15 +546,19 @@ Extra newlines between heading and content are swallowed
Heading with line break in nowiki
!! options
parsoid=wt2html
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
== A
b
!! end +!! test +No p-wrappable content +!! wikitext +x
+!! end + !! test Block tag on one line () !! wikitext @@ -4806,8 +4837,11 @@ foo//example.com/Foo !! end +## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia: !! test External links: with no contents +!! options +parsoid=wt2html,wt2wt !! wikitext [http://en.wikipedia.org/wiki/Foo] @@ -4821,8 +4855,8 @@ External links: with no contents !! html/parsoid - - + + !! end !! test @@ -4911,7 +4945,7 @@ External links: Free with trailing quotes (T113666) news:'a'b''c''d e !! html/phpNews: Stuff here -
news:'a'bcd e +
news:'a'bcd e
!! html/parsoidNews: Stuff here
@@ -5557,8 +5591,8 @@ External link containing a single quote. (T65947) [//foo.org/bar'baz bang] !! html/php -[1] -
bang +
[1] +
!! html/parsoid @@ -5676,7 +5710,7 @@ Examples from RFC 2732, section 2: !! html/phphttp://[2404:130:0:1000::187:2]/index.php -
Examples from RFC 2373, section 2.2: +
Examples from RFC 2373, section 2.2:
-
- http://[1080::8:800:200C:417A]/unicast
- http://[FF01::101]/multicast
@@ -5684,7 +5718,7 @@ Examples from RFC 2732, section 2:- http://[::]/unspecified
- http://[::13.1.68.3]/ipv4compat
- http://[::FFFF:129.144.52.38]/ipv4compat
Examples from RFC 2732, section 2: +
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
@@ -5697,7 +5731,7 @@ Examples from RFC 2732, section 2: !! html/parsoidhttp://[2404:130:0:1000::187:2]/index.php
-Examples from RFC 2373, section 2.2:
+Examples from RFC 2373, section 2.2:
-
- http://[1080::8:800:200C:417A]/unicast
- http://[FF01::101]/multicast
- http://[::1]/loopback
@@ -5705,7 +5739,7 @@ Examples from RFC 2732, section 2:- http://[::13.1.68.3]/ipv4compat
- http://[::FFFF:129.144.52.38]/ipv4compat
Examples from RFC 2732, section 2:
+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]
@@ -5739,7 +5773,7 @@ Examples from RFC 2732, section 2: !! html/phptest -
Examples from RFC 2373, section 2.2: +
Examples from RFC 2373, section 2.2:
-
- unicast
- multicast
@@ -5747,7 +5781,7 @@ Examples from RFC 2732, section 2:- unspecified
- ipv4compat
- ipv4compat
Examples from RFC 2732, section 2: +
Examples from RFC 2732, section 2:
- 1
- 2
@@ -5760,7 +5794,7 @@ Examples from RFC 2732, section 2: !! html/parsoid -Examples from RFC 2373, section 2.2:
+Examples from RFC 2373, section 2.2:
-
- unicast
- multicast
- loopback
@@ -5768,7 +5802,7 @@ Examples from RFC 2732, section 2:- ipv4compat
- ipv4compat
Examples from RFC 2732, section 2:
+Examples from RFC 2732, section 2:
+!! html/parsoid + !! end !! test @@ -8611,6 +8707,27 @@ Interwiki link with fragment (T4130) !! test Link scenarios with escaped fragments +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +[[#Is this great?]] +[[Foo#Is this great?]] +[[meatball:Foo#Is this great?]] +!! html/php +
- 1
- 2
- 3
@@ -5935,11 +5969,11 @@ parsoid=html2wt !! wikitext [[Foo|Bar]] [[Foo|Bar]] -[[wikipedia:Foo|Bar]] -[[wikipedia:Foo|Bar]] +[[:en:Foo|Bar]] +[[:en:Foo|Bar]] -[[wikipedia:European_Robin|European Robin]] -[[wikipedia:European_Robin|European Robin]] +[[:en:European_Robin|European Robin]] +[[:en:European_Robin|European Robin]] !! end !! test @@ -6320,7 +6354,7 @@ Accept "!!" in table data !! html/parsoid-
!! end @@ -6596,7 +6630,7 @@ parsoid=wt2html,html2html !! html/parsoid+ Foo!! Foo!! +
- [ftp://%7Cx ]" onmouseover="alert(document.cookie)">test [ftp://%7Cx ]" onmouseover="alert(document.cookie)">test !! end !! test @@ -6653,7 +6687,7 @@ parsoid=wt2html !! html/parsoid-
!! end @@ -6685,9 +6719,9 @@ Don't break on | in extension attribute in template+ style="color: red !important;" data-contrived="put this here foo style="color: red !important;" data-contrived="put this here foo !! html/parsoid - + - +
- â ha
!! end ## We don't support roundtripping of these attributes in Parsoid. @@ -7795,13 +7829,15 @@ Link with multiple pipes !! test Anchor containing a #. (T65430) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext [[Main Page#And#Link]] !! html/php - !! html/parsoid - + !! end !! test @@ -7919,13 +7955,27 @@ Link containing % as a double hex sequence interpreted to hex sequence ## Example for such a section: == < == !! test Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext [[%23%3c]][[%23%3e]] !! html/php - !! html/parsoid - + +!! end + +## Example for such a section: == < == +!! test +Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +[[%23%3c]][[%23%3e]] +!! html/php + !! end !! test @@ -7973,7 +8023,7 @@ Link containing double-single-quotes '' (T6598) !! wikitext [[Lista d''e paise d''o munno]] !! html/php - !! html/parsoid @@ -7987,7 +8037,7 @@ Link containing double quotes and spaces !! html/parsoid - + !! end !! test @@ -7995,7 +8045,7 @@ File containing double quotes and spaces !! wikitext [[File:Cool "Gator".png]] !! html/parsoid - + !! end !! test @@ -8038,12 +8088,12 @@ Link with double quotes in title part (literal) and alternate part (interpreted) [[''Pentecoste''|''Pentecoste'']] !! html/php
- â ha
File:Denys Savchenko Pentecoste.jpg -
!! html/parsoid - + @@ -8063,10 +8113,10 @@ Broken image links with HTML captions (T41700) abc !! html/parsoid - + !! end !! test @@ -8333,7 +8383,7 @@ language=kaa !! wikitext [[Something]]'nice !! html - !! end @@ -8517,6 +8567,31 @@ parsoid=html2wt,html2html Aðrir mótmælenda[[söfnuður]] !! end +!! test +Parsoid link bracket escaping +!! options +parsoid=html2wt,html2html +!! html/parsoid + + [Test]
+[[Test]]
+[[[Test]]]
+[[[[Test]]]]
+[[[[[Test]]]]]
+!! wikitext +[[Test]] + +[[[Test]]] + +[[[[Test]]]] + +[[[ [[Test]]]]] + +[[[[[[Test]]]]]] + +[[[[[ [[Test]]]]]]] +!! end + !! test Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved !! wikitext @@ -8545,13 +8620,26 @@ Parsoid: Scoped parsing should handle mixed transclusions and plain text !! test Link with angle bracket after anchor +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext [[Foo# ]] !! html/php - !! html/parsoid - + +!! end + +!! test +Link with angle bracket after anchor (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +[[Foo# ]] +!! html/php + !! end ### @@ -8568,7 +8656,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -8581,11 +8669,14 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end +## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia: !! test Interwiki link encoding conversion (T3636) +!! options +parsoid=wt2html,wt2wt !! wikitext *[[Wikipedia:ro:Olteniţa]] *[[Wikipedia:ro:Olteniţa]] @@ -8598,6 +8689,11 @@ Interwiki link encoding conversion (T3636) - Wikipedia:ro:OlteniÅ£a
- Wikipedia:ro:Olteniţa
#Is this great? +Foo#Is this great? +meatball:Foo#Is this great? +
+!! html/parsoid +#Is this great? +Foo#Is this great? +meatball:Foo#Is this great?
+!! end + +!! test +Link scenarios with escaped fragments (legacy) +!! config +wgFragmentMode=[ 'legacy' ] !! wikitext [[#Is this great?]] [[Foo#Is this great?]] @@ -8620,10 +8737,6 @@ Link scenarios with escaped fragments Foo#Is this great? meatball:Foo#Is this great? -!! html/parsoid -#Is this great? -Foo#Is this great? -meatball:Foo#Is this great?
!! end # Ideally the wikipedia: prefix here should be proto-relative too @@ -8648,19 +8761,19 @@ Different interwiki prefixes mapping to the same URL [[ wikiPEdia :Foo]] !! html/parsoid - + - + - + - + - + - + - + !! end !! test @@ -8680,9 +8793,9 @@ Interwiki links that cannot be represented in wiki syntax is just fragment !! html/parsoid -meatball:ok -ok with fragment -ok ending with ? mark +
meatball:ok +ok with fragment +ok ending with ? mark has query is just fragment
!! end @@ -8695,7 +8808,7 @@ Interwiki links: trail !! html/parsoid - + !! end !! test @@ -8749,7 +8862,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -8847,8 +8960,8 @@ Blah blah blah !! html/parsoidBlah blah blah -es:Spanish - zh : Chinese
+es:Spanish + zh : Chinese !! end !! test @@ -8865,7 +8978,7 @@ parsoid=wt2html [[:::es:Spanish]] !! html/parsoid -es:Spanish [[::es:Spanish]] [[:::es:Spanish]]
!! end @@ -8942,7 +9055,7 @@ parsoid=wt2html,wt2wt,html2html Blah blah blah [[zh:Chinese]] !! html/parsoid -Blah blah blah zh:Chinese
+Blah blah blah zh:Chinese
!! end ## PHP parser tests script needs an update @@ -8956,7 +9069,7 @@ parsoid=wt2html,wt2wt,html2html Blah blah blah [[zh:Chinese]] !! html/parsoid -Blah blah blah zh:Chinese
+Blah blah blah zh:Chinese
!! end !! test @@ -9043,7 +9156,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end @@ -9071,7 +9184,7 @@ Blah blah blah !! html/parsoidBlah blah blah -local:es:Spanish
+local:es:Spanish !! end !! test @@ -9114,10 +9227,12 @@ Blah blah blah # This tests the Parsoid bail-out code. !! test 3. Other redirect variants +!! options +parsoid=wt2html !! wikitext #REDIRECT [[[[Bar]] ]] !! html/parsoid -+
- REDIRECT [[[[Bar]]]]
!! end !! test @@ -9411,7 +9526,7 @@ Handling html with a div self-closing tag !! html/parsoid - + @@ -10935,10 +11050,10 @@ Magic links: RFC (T2479) !! wikitext RFC 822 !! html/php -
- REDIRECT [[[[Bar]]]]
RFC 822 +
!! html/parsoid - + !! end !! test @@ -10946,10 +11061,10 @@ Magic links: RFC (T67278) !! wikitext This is RFC 822 but thisRFC 822 is not RFC 822linked. !! html/php -This is RFC 822 but thisRFC 822 is not RFC 822linked. +
This is RFC 822 but thisRFC 822 is not RFC 822linked.
!! html/parsoid -This is RFC 822 but thisRFC 822 is not RFC 822linked.
+This is RFC 822 but thisRFC 822 is not RFC 822linked.
!! end !! test @@ -10959,12 +11074,12 @@ RFC 822 RFC 822 !! html/php -RFC 822 +
RFC 822 RFC 822
!! html/parsoid -RFC Â Â Â Â Â 822 RFC 822
!! end @@ -11060,14 +11175,14 @@ Magic links: use appropriate serialization for "almost" magic links. !! wikitext X[[Special:BookSources/0978739256|foo]] -X[//tools.ietf.org/html/rfc1234 foo] +X[https://tools.ietf.org/html/rfc1234 foo] !! html/phpXfoo -
Xfoo +
Xfoo
!! html/parsoidXfoo
-Xfoo
+Xfoo
!! end !! test @@ -11324,6 +11439,15 @@ Templates with templated name!! end +## Regression test; the output here isn't really that interesting. +!! test +Templates with templated name and top level template args +!! wikitext +{{1{{2{{{3}}}|4=5}}}} +!! html/parsoid +
- item 1
{{1{{2{{{3}}}|4=5}}}}
+!! end + # Parsoid markup is deliberate "broken". This is an edge case. # See long comment in TemplateHandler.js:convertAttribsToString. !! test @@ -11420,9 +11544,9 @@ Abort table cell attribute parsing on wikilink !! html/parsoid-
!! end @@ -11917,14 +12041,14 @@ some+ testing two | three four -three four -testing="two" | three four testing two | three four +three four +testing="two" | three four here
!! html/parsoid -hu
+hu
some
-
- stuff
- here
here
+here
!! end @@ -12448,6 +12572,8 @@ Preprocessor precedence 14: broken language converter in comment !! test Preprocessor precedence 15: broken brace markup in headings +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! options parsoid=wt2html !! wikitext @@ -12465,32 +12591,31 @@ __NOTOC__ __NOEDITSECTION__ ===6 foo-{bar 6=== 6 !! html/php+tidy -1 foo[bar 1
+1 foo[bar 1
1
-2 foo[[bar 2
+2 foo[[bar 2
2
-3 foo{bar 3
+3 foo{bar 3
3
-4 foo{{bar 4
+4 foo{{bar 4
4
-5 foo{{{bar 5
+5 foo{{{bar 5
5
-6 foo-{bar 6
+6 foo-{bar 6
6
!! html/parsoid - -1 foo[bar 1
+ +1 foo[bar 1
1
-2 foo[[bar 2
+2 foo[[bar 2
2
-3 foo{bar 3
+3 foo{bar 3
3
-4 foo{{bar 4
+4 foo{{bar 4
4
-5 foo{{{bar 5
+5 foo{{{bar 5
5
-6 foo-{bar 6
+6 foo-{bar 6
6
!! end @@ -14192,15 +14317,15 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test -Serialize simple image with figure-inline wrapper +Serialize simple image with span wrapper !! options parsoid=html2wt !! html/parsoid - + !! wikitext [[File:Foobar.jpg]] !! end @@ -14213,7 +14338,7 @@ Simple image (using File: namespace, now canonical) !! html/parsoid - + !! end !! test @@ -14330,7 +14455,7 @@ Linktrails should not work for images: [[File:Foobar.jpg]]sLinktrails should not work for images: s
!! html/parsoid -Linktrails should not work for images: s
+Linktrails should not work for images:
!! end !! test @@ -14376,7 +14501,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -14420,7 +14545,7 @@ thumbsize=220s 456
!! html/parsoid - +123
456
123
456
!! end @@ -14444,7 +14569,7 @@ Image with multiple widths -- use last !! html/parsoid - + !! end !! test @@ -14461,7 +14586,7 @@ thumbsize=220 !! html/parsoid - + !! end !! test @@ -14494,7 +14619,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -14505,7 +14630,7 @@ Image with link parameter, wiki target !! html/parsoid - + !! end # parsoid T51293 (part 1) @@ -14517,7 +14642,7 @@ Image with link parameter, URL target !! html/parsoid - + !! end # parsoid T51293 (part 2) @@ -14529,7 +14654,7 @@ Image with link parameter, protocol-less URL target !! html/parsoid - + !! end !! test @@ -14601,7 +14726,7 @@ Image with empty link parameter!! html/parsoid -
+
!! end !! test @@ -14612,7 +14737,7 @@ Image with link parameter (wiki target) and unnamed parameter !! html/parsoid - + !! end !! test @@ -14623,7 +14748,7 @@ Image with link parameter (URL target) and unnamed parameter !! html/parsoid - + !! end !! test @@ -14746,9 +14871,9 @@ Image with wiki markup in implicit alt !! html/parsoid - + - + !! end !! test @@ -14759,7 +14884,65 @@ Alt image option should handle most kinds of wikitext without barfing !! html/parsoid - + +!! end + +!! test +Image with table with attributes in caption +!! options +parsoid=wt2html,html2html +!! wikitext +[[File:Foobar.jpg|thumb| +{| class="123" | +|- class="456" | +| ha +|} +]] +!! html/parsoid + +!! end + +!! test +Image with table with rows from templates in caption +!! wikitext +[[File:Foobar.jpg|thumb| +{| +{{echo|{{!}} hi}} +|} +]] +!! html/parsoid + +!! end + +!! test +Image with nested tables in caption +!! wikitext +[[File:Foobar.jpg|thumb|Foo
+{| +| +{| +|z +|} +|} +]] +!! html/parsoid + !! end ################### @@ -14783,9 +14966,9 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - - - + + + !! end !! test @@ -14850,8 +15033,8 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - - + + !! end !! test @@ -14867,8 +15050,8 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - - + + !! end !! test @@ -14911,7 +15094,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -14927,8 +15110,8 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - - + + !! end !! test @@ -14986,7 +15169,7 @@ Frameless image caption with a free URL !! html/parsoid - + !! end !! test @@ -15046,12 +15229,12 @@ SVG thumbnails with invalid language code !! options parsoid=wt2html,wt2wt,html2html !! wikitext -[[File:Foobar.svg|thumb|caption|lang=invalid.language.code]] +[[File:Foobar.svg|thumb|caption|lang=invalid:language:code]] !! html/php - + !! html/parsoid - + !! end !! test @@ -15070,10 +15253,10 @@ T3887: A RFC with a thumbnail !! wikitext [[File:Foobar.jpg|thumb|This is RFC 12354]] !! html/php - + !! html/parsoid - + !! end !! test @@ -15096,7 +15279,7 @@ T2648: Frameless image caption with a link !! html/parsoid - + !! end !! test @@ -15107,7 +15290,7 @@ T2648: Frameless image caption with a link (suffix) !! html/parsoid - + !! end !! test @@ -15118,7 +15301,7 @@ T2648: Frameless image caption with an interwiki link !! html/parsoid - + !! end !! test @@ -15129,7 +15312,7 @@ T2648: Frameless image caption with a piped interwiki link !! html/parsoid - + !! end !! test @@ -15137,7 +15320,7 @@ T107474: Frameless image caption with!! wikitext [[File:Foobar.jpg| text with a [[MeatBall:Link|link]] in it ]] !! html/parsoid - + !! end !! test @@ -15148,7 +15331,7 @@ Escape HTML special chars in image alt text !! html/parsoid - + !! end !! test @@ -15161,7 +15344,7 @@ language=zh !! html/parsoid - + !! end !! test @@ -15172,7 +15355,7 @@ Entities in file name and attributes !! html/parsoid - + !! end !! test @@ -15183,7 +15366,7 @@ T2499: Alt text should have Ӓ, not &1234; !! html/parsoid - + !! end !! test @@ -15207,7 +15390,7 @@ Image caption containing another image !! html/parsoid - + !! end !! test @@ -15219,7 +15402,7 @@ Image: caption containing a newline !! html/parsoid - + !!end !!test @@ -15280,7 +15463,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -15334,7 +15517,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -15387,7 +15570,7 @@ wgEnableUploads=0 !! html/parsoid - + !! end # Parsoid-specific testing for images @@ -15402,7 +15585,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid - + !! end !! test @@ -15413,7 +15596,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid - + !! end !! test @@ -15422,7 +15605,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid - + !! end !! test @@ -15433,7 +15616,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid - + !! end !! test @@ -15441,7 +15624,7 @@ Parsoid-specific image handling - simple image with both sizes, a baseline align !! wikitext [[File:Foobar.jpg|500x10px|baseline|caption]] !! html/parsoid - + !! end !! test @@ -15449,7 +15632,7 @@ Parsoid-specific image handling - simple image with border and size spec !! wikitext [[File:Foobar.jpg|50px|border|caption]] !! html/parsoid - + !! end !! test @@ -15513,7 +15696,7 @@ Parsoid-specific image handling - frameless image with specific size, border, an !! wikitext [[File:Foobar.jpg|frameless|442x50px|border|caption]] !! html/parsoid - + !! end !! test @@ -15521,7 +15704,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|]] !! html/parsoid - + !! end !! test @@ -15591,7 +15774,7 @@ foo bar !! html/parsoid !! end @@ -15615,9 +15798,9 @@ T93580: 2. inside inline images
a b c !! html/parsoid - + - +
- â foo
!! end !! test @@ -15627,9 +15810,9 @@ T93580: 3. Templated inside inline images
- â foo
!! html/parsoid - + - +
- â foo
!! end ### @@ -15817,7 +16000,7 @@ Link to category !! wikitext [[:Category:MediaWiki User's Guide]] !! html -
- â foo
Category:MediaWiki User's Guide +
Category:MediaWiki User's Guide
!! end @@ -16180,11 +16363,9 @@ parsoid=wt2html,html2html Foo !! end -# NOTE that Parsoid does not currently implement this special case -# (T175416). The plan is to remove this weird special-case in the PHP -# parser to make it match the Parsoid output. +# Note that Parsoid differs slightly from PHP due to T175421 !! test -11. Special case where only newlines separate links +11. Special case where only newlines separate links (T175416) !! options parsoid=wt2html,html2html !! wikitext @@ -16194,7 +16375,9 @@ parsoid=wt2html,html2html [[Foo]] !! html/php -!! html/parsoid @@ -16455,8 +16638,11 @@ __FORCETOC__ !! end # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10' +# Parsoid html2wt direction adds
+Foo +for level 7 and up. !! test Handling of sections up to level 6 and beyond +!! options +parsoid=wt2html !! wikitext = Level 1 Heading= == Level 2 Heading== @@ -16468,7 +16654,7 @@ Handling of sections up to level 6 and beyond ======== Level 8 Heading======== ========= Level 9 Heading========= ========== Level 10 Heading========== -!! html +!! html/php Contents
- 1 Level 1 Heading @@ -16510,6 +16696,17 @@ Handling of sections up to level 6 and beyond
=== Level 9 Heading===[edit]
==== Level 10 Heading====[edit]
+!! html/parsoid +Level 1 Heading
+Level 2 Heading
+Level 3 Heading
+Level 4 Heading
+Level 5 Heading
+Level 6 Heading
+= Level 7 Heading=
+== Level 8 Heading==
+=== Level 9 Heading===
+==== Level 10 Heading====
!! end !! test @@ -16733,24 +16930,33 @@ http://example.com [[File:Foobar.jpg]] !! html/parsoid - + !!end +# Parsoid doesn't wt2wt this cleanly because it addss. !! test Short headings with trailing space should match behavior of Parser::doHeadings (T21910) +!! options +parsoid=wt2html,html2html !! wikitext === The line above must have a trailing space! === But just in case it doesn't... -!! html +!! html/php =[edit]
The line above must have a trailing space!
=[edit]
But just in case it doesn't...
+!! html/parsoid +=
+The line above must have a trailing space!
+=
+But just in case it doesn't...
!! end !! test @@ -16772,7 +16978,7 @@ section 4 == text " text == section 5 -!! html +!! html/phpThe tooltips shall not show entities to the user (ie. be double escaped)
@@ -16794,12 +17000,29 @@ section 5Contents
text & text[edit]
section 3
-text ' text[edit]
+text ' text[edit]
section 4
text " text[edit]
section 5
+!! html/parsoid +The tooltips shall not show entities to the user (ie. be double escaped)
+ +text > text
+section 1
+ +text < text
+section 2
+ +text & text
+section 3
+ +text ' text
+section 4
+ +text " text
+section 5
!! end !! test @@ -16831,7 +17054,7 @@ section 6 [[#Plus-Entity+between+Text]] [[#Underscore_between_Text]] [[#Underscore-Entity_between_Text]] -!! html +!! html/phpId should not contain + for spaces
@@ -16869,17 +17092,47 @@ section 6 #Underscore_between_Text #Underscore-Entity_between_Text +!! html/parsoid +Contents
Id should not contain + for spaces
+ +Space between Text
+section 1
+ +Space-Entity between Text
+section 2
+ +Plus+between+Text
+section 3
+ +Plus-Entity+between+Text
+section 4
+ +Underscore_between_Text
+section 5
+ +Underscore-Entity_between_Text
+section 6
+ +#Space between Text +#Space-Entity between Text +#Plus+between+Text +#Plus-Entity+between+Text +#Underscore_between_Text +#Underscore-Entity_between_Text
!! end +# Parsoid html2wt disabled because it adds padding spaces around = !! test Headers with excess '=' characters (Are similar tests necessary beyond the 1st level?) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext =foo== ==foo= =''italic'' heading== ==''italic'' heading= -!! html +!! html/php@@ -29530,9 +30085,526 @@ wgFragmentMode=[ 'html5' ]Contents
- 1 foo=
@@ -16894,6 +17147,11 @@ Headers with excess '=' charactersitalic heading=[edit]
=italic heading[edit]
+!! html/parsoid +foo=
+=foo
+italic heading=
+=italic heading
!! end !! test @@ -16909,7 +17167,7 @@ HTML headers vs TOC (T25393) == Header 2.1 == == Header 2.2 == __NOEDITSECTION__ -!! html +!! html/php@@ -29436,13 +29971,32 @@ wgFragmentMode=[ 'html5', 'legacy' ]Contents
- 1 Header 1 @@ -16934,6 +17192,16 @@ __NOEDITSECTION__
Header 2.1
Header 2.2
+!! html/parsoid +Header 1
+Header 1.1
+Header 1.2
+ +Header 2 +
+Header 2.1
+Header 2.2
+ !! end !! test @@ -16946,11 +17214,17 @@ parsoid=wt2html,wt2wt ==baz== -!! html -foo
-bar
-baz
+!! html/php +foo[edit]
+bar[edit]
+baz[edit]
+!! html/parsoid +foo
+bar
+baz
!! end !! test @@ -16961,7 +17235,7 @@ http://example.com[[File:Foobar.jpg]] !! html/parsoid - + !!end !! test @@ -17057,15 +17331,17 @@ parsoid=wt2html,html2html !! test div with multiple empty attribute values +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! options parsoid=wt2html,html2html !! wikitextHTML rocks!! html/php -HTML rocks+HTML rocks!! html/parsoid -HTML rocks+HTML rocks!! end !! test @@ -17391,7 +17667,7 @@ Image link to nonexistent file (T3850 - good) !! html/parsoid - + !! end !! test @@ -17643,9 +17919,11 @@ T4304: HTML attribute safety (unsafe breakout parameter 2; 2309) T4304: HTML attribute safety (link) !! wikitext -!! html - +!! html/php + +!! html/parsoid + !! end !! test @@ -17706,9 +17984,11 @@ T4304: HTML attribute safety (web link) T4304: HTML attribute safety (named web link) !! wikitext -!! html - +!! html/php + +!! html/parsoid + !! end !! test @@ -18272,18 +18552,16 @@ Nested template calls ### Sanitizer ### -# HTML+Tidy effectively strips out the empty tags completely -# But since Parsoid doesn't it wraps thetags in p-tags -# which Tidy would have done for the PHP parser had there been content inside it. +# HTML+Tidy strips out empty tags completely. Parsoid doesn't. +# FIXME: Wikitext for this first test doesn't match its title. !! test Sanitizer: Closing of open tags !! wikitext-!! html -
+!! html/php+tidy !! html/parsoid -
+
!! end !! test @@ -18319,13 +18597,26 @@ Table not started !! test Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext byte[[#æ: v|backlink]] !! html/php -
bytebacklink +
bytebacklink
!! html/parsoid -bytebacklink
+bytebacklink
+!! end + +!! test +Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +byte[[#æ: v|backlink]] +!! html/php +bytebacklink +
!! end # In HTML5, the restrictions are that id must contain at least one character, @@ -18388,6 +18679,37 @@ parsoid=wt2html,wt2wt2013
!! end +!! test +Sanitizer: Avoid unnecessary percent encoded characters in interwiki links +!! wikitext +[[meatball:Soft"Security]] +!! html/php + +!! html/parsoid + +!! end + +!! test +Sanitizer: angle brackets are invalid, even in interwiki links (T182338) +!! wikitext +[[meatball:FooBar]] +[[meatball:Foo<bar]] +[[meatball:Foo>bar]] +!! html/php + [[meatball:Foo<Bar]] +[[meatball:Foo>Bar]] +[[meatball:Foo<bar]] +[[meatball:Foo>bar]] +
+!! html/parsoid +[[meatball:Foo<Bar]] +[[meatball:Foo>Bar]] +[[meatball:Foo<bar]] +[[meatball:Foo>bar]]
+!! end + !! test Language converter: output gets cut off unexpectedly (T7757) !! options @@ -18413,6 +18735,24 @@ all additional text is vanishedall additional text is vanished
!! end +!! test +Language converter glossary rules inside attributes (T119158) +!! options +language=sr variant=sr-el +!! wikitext +-{H|foAjrjvi=>sr-el:" onload="alert(1)" data-foo="}- + +[[File:Foobar.jpg|alt=-{}-foAjrjvi-{}-]] +!! html/php ++
+!! html/parsoid + + + +!! end + !! test Self closed html pairs (T7487) !! wikitext @@ -18731,12 +19071,15 @@ Fuzz testing: Parser13 !! end +# Note that Parsoid output differs from the PHP parser here: the PHP +# parser breaks the URL for the magic word, while in Parsoid the URL +# production takes precedence. !! test Fuzz testing: Parser14 !! wikitext == onmouseover= == http://__TOC__ -!! html +!! html/phponmouseover=[edit]
http://Contents
@@ -18745,7 +19088,7 @@ http://
-!! html+tidy +!! html/php+tidyContents
onmouseover=[edit]
http://
@@ -18757,6 +19100,9 @@ http://+!! html/parsoid +Contents
onmouseover=
+ !! end !! test @@ -18780,7 +19126,7 @@ parsoid=wt2html,html2html !! html/parsoid -a
+a
!! end @@ -18955,15 +19301,45 @@ Fuzz testing: image with bogus manual thumbnail !! end +# Parsoid will emit the newline literally in wt2wt; see next test case. !! test Fuzz testing: encoded newline in generated HTML replacements (T8577) +!! options +parsoid=wt2html !! wikitext !! html/php !! html/parsoid - + +!! end + +!! test +Fuzz testing: encoded newline in generated HTML replacements, html2wt (T8577) +!! options +parsoid=html2wt +!! html/parsoid + +!! wikitext + +!! html/php + + +!! end + +!! test +Templates in extension attributes are not expanded +!! wikitext + +!! html/php + + +!! html/parsoid + !! end !! test @@ -19993,7 +20369,7 @@ parsoid=wt2html ''''' !! html/php !! html/parsoid -
+ !! end # same html as previous, but wikitext adjusted to match parsoid html2wt @@ -20117,7 +20493,7 @@ File:File:Foobar.jpg !! html/parsoid
-
!! end @@ -20180,12 +20556,12 @@ image4 |300px| centre !! html/parsoid- +
-
!! end @@ -20243,11 +20619,11 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. !! html/parsoid !! end @@ -20304,11 +20680,11 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. !! html/parsoid - !! end @@ -20348,9 +20724,9 @@ image:foobar.jpg|link=Main Page#section|caption !! html/parsoid -- -
- -
- -
- -
- -
- +
- +
- +
- +
- +
- +
-
!! end @@ -20380,7 +20756,7 @@ File:Foobar.jpg|{{echo|ho}} !! html/parsoid- -
- -
- +
caption- +
- +
caption!! end @@ -20415,8 +20791,8 @@ File:Foobar.jpg|alt=galleryalt|{{Test|unamedParam|alt=param}} !! html/parsoid -
- +
ho ho-
!! end @@ -20469,10 +20845,10 @@ some caption Main Page !! html/parsoid- -
- +
This is a test template- +
This is a test template-
!! end @@ -20517,27 +20893,27 @@ foobar.jpg !! html/parsoid- -
File:Nonexistent.jpgcaption- -
- -
File:Foobar.jpgsome caption Main Page- +
- +
File:Nonexistent.jpgcaption- +
- +
File:Foobar.jpgsome caption Main Page-
!! end !! test -Gallery override link with WikiLink (T36852) +Gallery override link with wikilink (T36852) !! options parsoid={ "nativeGallery": true } !! wikitext- -
- -
- -
- +
- +
- +
- +
-File:Foobar.jpg|alt=galleryalt|link=InterWikiLink +File:Foobar.jpg|alt=galleryalt|link=Wikilink !! html/php!! html/parsoid -
- @@ -20545,7 +20921,7 @@ File:Foobar.jpg|alt=galleryalt|link=InterWikiLink !! html/parsoid
-
!! end @@ -20570,7 +20946,7 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org !! html/parsoid- +
-
!! end @@ -20617,7 +20993,7 @@ File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code! !! html/parsoid- +
-
!! end @@ -20644,7 +21020,7 @@ File:Foobar.jpg|link=< !! html/parsoid- +
-
!! end @@ -20687,7 +21063,7 @@ File:Foobar.jpg !! html/parsoid- +
link=< link=<-
!! end @@ -20712,7 +21088,7 @@ File:Foobar.jpg !! html/parsoid !! end @@ -20886,7 +21262,7 @@ Double RFC !! wikitext RFC RFC 1234 !! html -- +
RFC RFC 1234 +
RFC RFC 1234
!! end @@ -20904,10 +21280,10 @@ RFC code coverage !! wikitext RFC 983 987 !! html -RFC 983 987 +
RFC 983 987
!! html+tidy -RFC 983 987
+RFC 983 987
!! end !! test @@ -20974,7 +21350,7 @@ djvu !! html/parsoid - + !! end !! test @@ -21332,47 +21708,94 @@ ISBN 1 234 56789 0 - 2006 !! test anchorencode +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext {{anchorencode:foo bar©#%n}} -!! html +!! html/php +foo_bar©#%n +
+!! html/parsoid +foo_bar©#%n
+!! end + +!! test +anchorencode (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +{{anchorencode:foo bar©#%n}} +!! html/phpfoo_bar.C2.A9.23.25n
!! end !! test anchorencode trims spaces +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext {{anchorencode: __pretty__please__}} -!! html +!! html/phppretty_please
+!! html/parsoid +pretty_please
!! end !! test anchorencode deals with links +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext {{anchorencode: [[hello|world]] [[hi]]}} -!! html +!! html/phpworld_hi
+!! html/parsoid +world_hi
!! end !! test anchorencode deals with templates +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -{{anchorencode: {{Foo}} }} -!! html -FOO +{{anchorencode: {{Foo}} x}} +!! html/php +
FOO_x
+!! html/parsoid +FOO_x
!! end !! test anchorencode encodes like the TOC generator: (T20431) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +=== _ +:.3A%3A _ &&]] x === +{{anchorencode: _ +:.3A%3A _ &&]] x}} +__NOEDITSECTION__ +!! html/php +_ +:.3A%3A _ &&]] x
++:.3A%3A_&&]]_x +
+!! html/parsoid +_ +:.3A%3A _ &&]] x
++:.3A%3A_&&]]_x
+ +!! end + +!! test +anchorencode encodes like the TOC generator: (T20431) (legacy) +!! config +wgFragmentMode=[ 'legacy' ] !! wikitext === _ +:.3A%3A&&]] === {{anchorencode: _ +:.3A%3A&&]] }} __NOEDITSECTION__ -!! html +!! html/php_ +:.3A%3A&&]]
.2B:.3A.253A.26.26.5D.5D
@@ -21648,6 +22071,8 @@ language=sr variant=sr-ec !! test -{}- tags within headlines (within html for parserConvert()) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! options language=sr variant=sr-ec !! wikitext @@ -21658,14 +22083,14 @@ conversion: == Latinski == !! html/php -Naslov[ÑÑеди]
+Naslov[ÑÑеди]
ÐоÑе ÑÑ Ð°Ñ ÐµÐ²ÐµÐ½ ан ÑнпÑоÑеÑÑед Ñ ÐµÐ°Ð´Ð»Ð¸Ð½Ðµ ÐÐ Ð¸Ñ Ð½Ð¾Ñ Ð°ÑÑеÑÑед бy лангÑаге ÑонвеÑÑион:
ÐаÑинÑки[ÑÑеди]
!! html/parsoid -+
Note that even an unprotected headline ID is not affected by language conversion:
@@ -22179,7 +22604,7 @@ Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:TaiwNested: Hello Hong Kong!
!! html/parsoid -Nested: !
+Nested: !
!! end !! test @@ -22192,7 +22617,7 @@ language=zh variant=zh-cnA
!! html/parsoid -+
!! end !! test @@ -22205,7 +22630,7 @@ language=zh variant=zh-cn
A
!! html/parsoid -+
!! end # Parsoid and PHP disagree on how to parse this example: Parsoid @@ -22298,7 +22723,7 @@ parsoid={ |} !! end -# Tests LanguageVariantText._fromSelser +# Tests LanguageVariantText._fromSelSer !! test LanguageConverter selser (4) !! options @@ -22478,15 +22903,9 @@ File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt
-
- - - -
-- - -
+This is a test template-+
!! end @@ -22672,6 +23091,21 @@ a:b=>c xyz !! end +!! test +T179579: Nowiki and lc interaction +!! options +parsoid=wt2html +language=sr +!! wikitext +-{123}- + +-{123- +
This is a test template| 456}- +!! html/parsoid ++ +
+!! end + !! test T2529: Uncovered bullet !! wikitext @@ -23656,7 +24090,7 @@ percent-encoding and + signs in internal links (T28410) !! html/parsoid
User:+% Page+title% %+ %20 %+ %+r -% + +% +
!! end @@ -23670,8 +24104,8 @@ Special characters in embedded file links (T29679) Title with & ampersand !! html/parsoid - + !! end !! test @@ -23818,7 +24252,7 @@ __TOC__ !! html/parsoid -3E 3E+ Lost episodes
+Lost episodes
!! end !! test @@ -23839,7 +24273,7 @@ __TOC__ !! html/parsoid -should be bold then normal text
+should be bold then normal text
!! end !! test @@ -23860,7 +24294,7 @@ __TOC__ !! html/parsoid -Image
+Image
!! end !! test @@ -23897,11 +24331,13 @@ __TOC__[edit]
!! html/parsoid -+
Quote!! end !! test Unclosed tags in TOC +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! options title=[[Main Page]] !! wikitext @@ -23912,17 +24348,17 @@ QED !! html/php
Quote-Contents
Proof: 2 < 3[edit]
+Proof: 2 < 3[edit]
Hanc marginis exiguitas non caperet. QED
!! html/parsoid -Proof: 2 < 3
+Proof: 2 < 3
Hanc marginis exiguitas non caperet. QED
!! end @@ -23965,8 +24401,9 @@ __TOC__[edit]
!! html/parsoid -Foo Bar
-Foo
+BarFoo Bar
+ +Foo
!! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to @@ -23993,9 +24430,9 @@ __TOC__ !! html/parsoid -BarHello
+Hello
-b">Evilbye
+b">Evilbye
!! end !! test @@ -24030,11 +24467,11 @@ __TOC__ !! html/parsoid -C++
-××× ×!
-The attributes on these span tags must be deleted from the TOC
-All attributes on these span tags must be deleted from the TOC
-Attributes after dir on these span tags must be deleted from the TOC
+C++
+××× ×!
+The attributes on these span tags must be deleted from the TOC
+All attributes on these span tags must be deleted from the TOC
+Attributes after dir on these span tags must be deleted from the TOC
!! end !! test @@ -24053,7 +24490,7 @@ __TOC__ !! html/parsoid -test
+test
!! end !! test @@ -24072,7 +24509,7 @@ __TOC__ !! html/parsoid -+
testtesttest!! end # Note that the html output does not have the , but the @@ -24106,7 +24543,7 @@ __TOC__
testtesttestx[edit]
!! html/parsoid -x
+x
!! end !! article @@ -24229,9 +24666,11 @@ Strip marker in padright Strip marker in anchorencode !! wikitext {{anchorencode:xy}} -!! html +!! html/php xy
+!! html/parsoid +xy
!! end !! test @@ -24448,9 +24887,7 @@ parsoid=wt2html,wt2wt !! wikitext '''[[Image:Foobar.jpg|right|300px]]''' !! html/parsoid -- - + !! end #### ---------------------------------------------------------------- @@ -24692,16 +25129,59 @@ Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt !! html/parsoid -
=== -=foo= x +
=foo= x =foo=
!! wikitext -=== =foo= x =foo=+!! html/php +=foo= x +=foo=
!!end +!! test +Headings: 4c. Short headings (1) +!! options +parsoid=html2wt +!! html/parsoid ++=== +
+!! wikitext +=== +!! html/php +=== +
+!! end + +# in the html2wt direction we emit '= = =' or '== =' +!! test +Headings: 4d. Short headings (2) +!! options +parsoid=wt2html,html2html +!! wikitext += +== +=== +==== +===== +!! html/php += +== +
+=[edit]
+==[edit]
+=[edit]
+ +!! html/parsoid += +==
+=
+==
+=
+!! end + !! test Headings: 5. Empty headings !! options @@ -25649,9 +26129,9 @@ Links 8. Adds between text-nodes and RFC-links when required (T66300) !! options parsoid=html2wt !! html/parsoid - + !! wikitext RFC 123 4 RFC 123 y @@ -25663,18 +26143,18 @@ Links 9. Don't add spurious s between text-nodes and RFC-links (T66300) !! options parsoid=html2wt !! html/parsoid - RFC 123?foo -RFC 123&foo --RFC 123- +
RFC 123?foo +RFC 123&foo +-RFC 123-
!! wikitext RFC 123?foo RFC 123&foo -RFC 123- !! html/php -RFC 123?foo -RFC 123&foo --RFC 123- +
RFC 123?foo +RFC 123&foo +-RFC 123-
!! end @@ -27288,7 +27768,7 @@ Image: upright option is ignored on inline and frame images (parsoid) !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] !! html/parsoid - + !! end !! test @@ -27296,7 +27776,7 @@ Image: in template parameter with empty parameter !! wikitext {{echo|[[File:Foobar.jpg|link=]]}} !! html/parsoid -+
!! end !! test @@ -27349,7 +27829,7 @@ Image: Invalid title as link !! html/parsoid - + !! end !! test @@ -27935,9 +28415,9 @@ Edited RFC links not serializable as RFC links should serialize as extlinks !! options parsoid=html2wt !! html/parsoid -New RFC +New RFC !! wikitext -[//tools.ietf.org/html/rfc123 New RFC] +[https://tools.ietf.org/html/rfc123 New RFC] !! end !! test @@ -28081,7 +28561,7 @@ Magic links inside image captions (autolinked)
@@ -28100,7 +28580,7 @@ Magic links inside image captions (autolinked)!! html/parsoid - + !! end @@ -28200,17 +28680,17 @@ parsoid=html2wt+ a b - c c + x
-y y !! wikitext {| @@ -28375,6 +28855,14 @@ parsoid=wt2html
+ a b - c c + x -
y y hiho
!! end +!! test +Catch regression when unpacking with trailing content +!! wikitext +{{echo|Foobar}} +!! html/parsoid + Foo
bar
+!! end + !! test Use data-parsoid.firstWikitextNode to compute newline constraints for template content !! options @@ -29376,6 +29864,24 @@ wgRawHtml=1 !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +== A&B&C&D&amp;E == +[[#A&B&C&D&amp;E]] +!! html/php +A&B&C&D&amp;E[edit]
+ +!! html/parsoid +A&B&C&D&amp;E
+ +!! end + +!! test +Decoding of HTML entities in headings and links for IDs and link fragments (T103714) (legacy) +!! config +wgFragmentMode=[ 'legacy' ] !! wikitext == A&B&C&D&amp;E == [[#A&B&C&D&amp;E]] @@ -29385,17 +29891,46 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103 !! end +!! test +Decoding of HTML entities in embedded HTML tags +!! wikitext ++!! html/php +
x + +!! html/parsoid +
x +!! end + !! test Decoding of HTML entities in indicator names for IDs (T104196) !! options +parsoid=wt2html,html2html showindicators !! wikitext
x Indicator !! html/php 1&2&3&4&5=Indicator +!! html/parsoid +!! end +# this version of the test strips out the ambiguity so Parsoid rts cleanly +!! test +Decoding of HTML entities in indicator names for IDs (unambiguous) (T104196) +!! options +showindicators +!! wikitext +
Indicator +!! html/php +1&2&3&4&5=Indicator + +!! html/parsoid ++!! end + +# This fragment mode is what Parsoid supports. !! test HTML5 ids: fallback to legacy !! config @@ -29427,7 +29962,7 @@ wgFragmentMode=[ 'html5', 'legacy' ]
- 3 ТеÑÑ
- 4 ТеÑÑ
- 5 ÑеÑÑ
-- 6 Hey < # " > % : '
+- 6 Hey < # " > % : '
ТеÑÑ[edit]
ТеÑÑ[edit]
ÑеÑÑ[edit]
-Hey < # " > % : '[edit]
-#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : ' +
Hey < # " > % : '[edit]
+#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
ð©
+!! html/parsoid +Foo bar
+ +foo Bar
+ +ТеÑÑ
+ +ТеÑÑ
+ +ÑеÑÑ
+ +Hey < # " > %Â : '
+#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
+ +ð©
+ + + !! end +# Parsoid doesn't support this mode !! test HTML5 ids: legacy with a fallback to modern !! config @@ -29483,13 +30037,14 @@ wgFragmentMode=[ 'legacy', 'html5' ]ТеÑÑ[edit]
ТеÑÑ[edit]
ÑеÑÑ[edit]
-Hey < # " > % : '[edit]
+Hey < # " > % : '[edit]
#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
.F0.9F.92.A9
!! end +# Parsoid doesn't support this mode. !! test HTML5 ids: no legacy !! config @@ -29521,7 +30076,7 @@ wgFragmentMode=[ 'html5' ]- 3 ТеÑÑ
- 4 ТеÑÑ
- 5 ÑеÑÑ
-- 6 Hey < # " > % : '
+- 6 Hey < # " > % : '
ТеÑÑ[edit]
ТеÑÑ[edit]
ÑеÑÑ[edit]
-Hey < # " > % : '[edit]
-#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : ' +
Hey < # " > % : '[edit]
+#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
ð©
!! end + +!! test +T90902: Normalize weird characters in section IDs +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +== Foo bar == +[[#Foo bar]] + +!! html/php +Foo bar[edit]
+#Foo bar +
+!! end + +!! test +T51672: Test for brackets in attributes of elements in external link texts +!! wikitext +[http://example.com/ link span] +[http://example.com/ link span] + +!! html/php + +!! html/parsoid + +!! end + +!! test +T72875: Test for brackets in attributes of elements in internal link texts +!! wikitext +[[Foo|link span]] +[[Foo|link span]] + +!! html/php + +!! html/parsoid + +!! end + +!! test +T179544: {{anchorencode:}} output should be always usable in links +!! config +wgFragmentMode=[ 'html5' ] +!! wikitext +[[#{{anchorencode:[foo]}}]] +!! html/php +#[foo] +
+!! html/parsoid + +!! end + +## ------------------------------ +## Parsoid section-wrapping tests +## ------------------------------ +!! test +Section wrapping for well-nested sections (no leading content) +!! options +parsoid={ + "wrapSections": true +} +!! wikitext += 1 = +a + += 2 = +b + +== 2.1 == +c + +== 2.2 == +d + +=== 2.2.1 === +e + += 3 = +f +!! html/parsoid +1
+a
+ +2
+b
+ +2.1
+c
+ +2.2
+d
+ +2.2.1
+e
+ ++!! end + +!! test +Section wrapping for well-nested sections (with leading content) +!! options +parsoid={ + "wrapSections": true +} +!! wikitext +Para 1. + +Para 2 with a 3
+f
+ +nested in it+ +Para 3. + += 1 = +a + += 2 = +b + +== 2.1 == +c +!! html/parsoid +Para 1.
+ +Para 2 with a
nested in it+ +Para 3.
+ +1
+a
+ ++!! end + +!! test +Section wrapping with template-generated sections (good nesting 1) +!! options +parsoid={ + "wrapSections": true +} +!! wikitext += 1 = +a + +{{echo|1= +== 1.1 == +b +}} + +== 1.2 == +c + += 2 = +d +!! html/parsoid + 2
+b
+ +2.1
+c
+ +1
+a
+ +1.1
+b
+1.2
+c
+ ++!! end + +# In this example, the template scope is mildly expanded to incorporate the +# trailing newline after the transclusion since that is part of section 1.1.1 +!! test +Section wrapping with template-generated sections (good nesting 2) +!! options +parsoid={ + "wrapSections": true, + "modes": ["wt2html", "wt2wt"] +} +!! wikitext += 1 = +a + +{{echo|1= +== 1.1 == +b +=== 1.1.1 === +d +}} += 2 = +e +!! html/parsoid + 2
+d
1
+a
+ +1.1
+b
+1.1.1
+d
++!! end + +# In this example, the template scope is mildly expanded to incorporate the +# trailing newline after the transclusion since that is part of section 1.2.1 +!! test +Section wrapping with template-generated sections (good nesting 3) +!! options +parsoid={ + "wrapSections": true, + "modes": ["wt2html", "wt2wt"] +} +!! wikitext += 1 = +a + +{{echo|1= +x +== 1.1 == +b +==1.2== +c +===1.2.1=== +d +}} += 2 = +e +!! html/parsoid + 2
+e
1
+a
+ +x
+1.1
+b
+1.2
+c
+1.2.1
+d
++!! end + +# Because of section-wrapping and template-wrapping interactions, +# the scope of the template is expanded so that the template markup +# is valid in the presence of 2
+e
tags. +# This exercises the s1 is null scenario in the wrapSections code +!! test +Section wrapping with template-generated sections (bad nesting 1) +!! options +parsoid={ + "wrapSections": true +} +!! wikitext + +a + +{{echo| += 1 = +b +}} + +c ++!! html/parsoid ++!! end + +# Because of section-wrapping and template-wrapping interactions, +# the scope of the template is expanded so that the template markup +# is valid in the presence of +a
+ + +1
+b +
+ +c
+tags. +# This exercises the s1 is ancestor of s2 scenario in the wrapSections code +!! test +Section wrapping with template-generated sections (bad nesting 2) +!! options +parsoid={ + "wrapSections": true +} +!! wikitext += 1 = +a + +{{echo|1= += 2 = +b +== 2.1 == +c +}} + +d + += 3 = +e +!! html/parsoid + 1
+a
+ +2
+b
+2.1
+c
+ +d
+ ++!! end + +# Because of section-wrapping and template-wrapping interactions, +# additional template wrappers are added to 3
+e
tags +# so that template wrapping semantics are valid whether section +# tags are retained or stripped. But, the template scope can expand +# greatly when accounting for section tags. +# This exercises the s1 and s2 are in different subtrees scenario +!! test +Section wrapping with template-generated sections (bad nesting 3) +!! options +parsoid={ + "wrapSections": true, + "modes": ["wt2html", "wt2wt"] +} +!! wikitext += 1 = +a + +{{echo|1= +== 1.2 == +b += 2 = +c +}} + +d + += 3 = +e +!! html/parsoid + 1
+a
+ +1.2
+b
+2
+c
+ +d
++!! end + +!! test +Section wrapping with uneditable lead section + div wrapping multiple sections +!! options +parsoid={ + "wrapSections": true +} +!! wikitext +foo + + 3
+e
+= 1 = +a + +== 1.1 == +b + += 2 = +c ++ += 3 = +d + +== 3.1 == +e +!! html/parsoid +foo
+ + ++ +1
+a
+ +1.1
+b
+ +2
+c
++!! end + +!! test +Section wrapping with editable lead section + div overlapping multiple sections +!! options +parsoid={ + "wrapSections": true +} +!! wikitext +foo + += 1 = +a + 3
+d
+ +3.1
+e
++b + +== 1.1 == +c + += 2 = +d ++e + += 3 = +f + +== 3.1 == +g +!! html/parsoid +foo
+ +1
+a
+ ++b
+ +1.1
+c
+ +2
+d
+e
+ ++!! end + +!! test +HTML header tags should not be wrapped in section tags +!! options +parsoid={ + "wrapSections": true +} +!! wikitext +foo + + 3
+f
+ +3.1
+g
+a
+ += b = + +c
+ += d = +!! html/parsoid +foo
+ +a
+ +b
+ +c
+ ++!! end + +!! test +Lead section containing only whitespace and comments. +!! options +parsoid={ + "wrapSections": true +} +!! wikitext + + += 1 = +a + += 2 = +b +!! html/parsoid + d
+ + 1
+a
+ ++!! end 2
+b