X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=fb549f5ae184b2c38170a3dc89df0a5c0cbe359d;hp=3c861ea10b33494b8bed013a650c70ca904eb6cd;hb=f21f3942eb10d7e688eb25261ac3a9478268cbd3;hpb=89b0452fcab09cd18c53c373f668a0180168a2d4 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 3c861ea10b..fb549f5ae1 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1912,6 +1912,33 @@ a
b
!! end +!! test +No p-wrappable content +!! wikitext +x
+!! end + !! test Block tag on one line () !! wikitext @@ -4806,8 +4833,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] @@ -4911,7 +4941,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 +5587,8 @@ External link containing a single quote. (T65947) [//foo.org/bar'baz bang] !! html/php -[1] -
bang +
[1] +
!! html/parsoid @@ -5676,7 +5706,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 +5714,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 +5727,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 +5735,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:
@@ -29530,9 +29649,23 @@ wgFragmentMode=[ 'html5' ]
- 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 +5769,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 +5777,7 @@ Examples from RFC 2732, section 2:- unspecified
- ipv4compat
- ipv4compat
Examples from RFC 2732, section 2: +
Examples from RFC 2732, section 2:
@@ -29436,8 +29555,8 @@ wgFragmentMode=[ 'html5', 'legacy' ]
- 1
- 2
@@ -5760,7 +5790,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 +5798,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 @@ -9411,7 +9474,7 @@ Handling html with a div self-closing tag !! html/parsoid - + @@ -10935,10 +10998,10 @@ Magic links: RFC (T2479) !! wikitext RFC 822 !! html/php -
- 1
- 2
- 3
@@ -5935,11 +5965,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 @@ -7973,7 +8003,7 @@ Link containing double-single-quotes '' (T6598) !! wikitext [[Lista d''e paise d''o munno]] !! html/php - !! html/parsoid @@ -8038,9 +8068,9 @@ Link with double quotes in title part (literal) and alternate part (interpreted) [[''Pentecoste''|''Pentecoste'']] !! html/phpFile:Denys Savchenko Pentecoste.jpg -
!! html/parsoid @@ -8333,7 +8363,7 @@ language=kaa !! wikitext [[Something]]'nice !! html - !! end @@ -8517,6 +8547,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 @@ -8584,8 +8639,11 @@ parsoid=wt2html,wt2wt,html2html !! 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 +8656,11 @@ Interwiki link encoding conversion (T3636) - Wikipedia:ro:OlteniÅ£a
- Wikipedia:ro:Olteniţa
RFC 822 +
!! html/parsoid - + !! end !! test @@ -10946,10 +11009,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 +11022,12 @@ RFC 822 RFC 822 !! html/php -RFC 822 +
RFC 822 RFC 822
!! html/parsoid -RFC Â Â Â Â Â 822 RFC 822
!! end @@ -11060,14 +11123,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 +11387,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 @@ -14762,6 +14834,28 @@ Alt image option should handle most kinds of wikitext without barfing !! end +!! test +Image with nested tables in caption +!! wikitext +[[File:Foobar.jpg|thumb|Foo
+{| +| +{| +|z +|} +|} +]] +!! html/parsoid + +!! end + ################### # Conflicting image format options. # First option specified should 'win'. @@ -15070,10 +15164,10 @@ T3887: A RFC with a thumbnail !! wikitext [[File:Foobar.jpg|thumb|This is RFC 12354]] !! html/php - + !! html/parsoid - + !! end !! test @@ -15615,9 +15709,9 @@ T93580: 2. inside inline images!! html/parsoid - + - +
- â foo
!! end !! test @@ -15627,9 +15721,9 @@ T93580: 3. Templated inside inline images
- â foo
!! html/parsoid - + - +
- â foo
!! end ### @@ -15817,7 +15911,7 @@ Link to category !! wikitext [[:Category:MediaWiki User's Guide]] !! html -
- â foo
Category:MediaWiki User's Guide +
Category:MediaWiki User's Guide
!! end @@ -16794,7 +16888,7 @@ section 5text & text[edit]
section 3
-text ' text[edit]
+text ' text[edit]
section 4
text " text[edit]
@@ -18272,18 +18366,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 @@ -18413,6 +18505,20 @@ all additional text is vanished
all additional text is vanished
!! end +!! test +Language converter glossary rules inside attributes (T119158) +!! options +language=sr variant=sr-el +!! wikitext +-{H|abc=>sr-el:" onload="alert(1)" data-foo="}- + +[[File:Foobar.jpg|alt=-{}-abc-{}-]] +!! html ++
+!! end + !! test Self closed html pairs (T7487) !! wikitext @@ -19993,7 +20099,7 @@ parsoid=wt2html ''''' !! html/php !! html/parsoid -+ !! end # same html as previous, but wikitext adjusted to match parsoid html2wt @@ -20886,7 +20992,7 @@ Double RFC !! wikitext RFC RFC 1234 !! html -
RFC RFC 1234 +
RFC RFC 1234
!! end @@ -20904,10 +21010,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 @@ -22298,7 +22404,7 @@ parsoid={ |} !! end -# Tests LanguageVariantText._fromSelser +# Tests LanguageVariantText._fromSelSer !! test LanguageConverter selser (4) !! options @@ -22672,6 +22778,21 @@ a:b=>c xyz !! end +!! test +T179579: Nowiki and lc interaction +!! options +parsoid=wt2html +language=sr +!! wikitext +-{123}- + +-{123| 456}- +!! html/parsoid ++ +
+!! end + !! test T2529: Uncovered bullet !! wikitext @@ -24448,9 +24569,7 @@ parsoid=wt2html,wt2wt !! wikitext '''[[Image:Foobar.jpg|right|300px]]''' !! html/parsoid -
- - + !! end #### ---------------------------------------------------------------- @@ -25649,9 +25768,9 @@ Links 8. Add
s between text-nodes and RFC-links when required (T66300) !! options parsoid=html2wt !! html/parsoid - + !! wikitext RFC 123 4 RFC 123 y @@ -25663,18 +25782,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 @@ -27935,9 +28054,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 +28200,7 @@ Magic links inside image captions (autolinked)@@ -28100,7 +28219,7 @@ Magic links inside image captions (autolinked)!! html/parsoid - + !! end @@ -29427,7 +29546,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 < # " > % : '
ð©
@@ -29483,7 +29602,7 @@ wgFragmentMode=[ 'legacy', 'html5' ]ТеÑÑ[edit]
ТеÑÑ[edit]
ÑеÑÑ[edit]
-Hey < # " > % : '[edit]
+Hey < # " > % : '[edit]
#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
.F0.9F.92.A9
#å¤é #å¤é @@ -29521,7 +29640,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