X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=3fd61588bb5247ebef0d6590ebb8b17bbe84a0e8;hb=f2d4db9d03a984d998db9044e63e548597511eb6;hp=d2fbd8d302b6ae7de61dc2250f44277ad89c423c;hpb=72fd6adca712c2805b0c47371f16a8cfca0e5c5d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index d2fbd8d302..3fd61588bb 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -2359,6 +2359,17 @@ parsoid=wt2html,html2html

ho

!! end +!! test +P-wrapping non-breaking spaces +!! wikitext +  +!! html/php+tidy +

  +

+!! html/parsoid +

 

+!! end + ### ### Preformatted text ### @@ -6273,8 +6284,6 @@ parsoid=wt2html !! end -# Note that the PHP parser output appears to be broken when the table -# end tag is not separated by a space from the style attribute !! test A table with stray table end tags on start tag line (wt2html) !! options @@ -6294,13 +6303,13 @@ parsoid=wt2html |foo |} !! html/php+tidy - +
foo
- +
foo
@@ -9652,17 +9661,14 @@ Handling html with a div self-closing tag
-!! html/php -

<div title /> -<div title/> -

-
-

<div title=bar /> -<div title=bar/> -

-
-
- +!! html/php+tidy +
+
+
+
+
+
+
!! html/parsoid
@@ -9703,10 +9709,10 @@ Handling html with a br self-closing tag


-!! html/php +!! html/php+tidy



-
+



@@ -9721,6 +9727,18 @@ Handling html with a br self-closing tag

!! end +!! test +Quoted attributes without spaces +!! options +parsoid=wt2html +!! wikitext +
red
+!! html/php+tidy +
red
+!! html/parsoid +
red
+!! end + !! test Horizontal ruler (should it add that extra space?) !! wikitext @@ -15476,6 +15494,37 @@ File:Foobar.jpg|link=Foo''s_bar''s|caption !! end +!! test +HTML entity prefix in link markup (T209236) +!! wikitext +[[File:Foobar.jpg|link=https://example.com?foo¶ms=bar]] + + + +File:Foobar.jpg|link=https://example.com?foo¶ms=bar + +!! html/php+tidy +

Foobar.jpg +

+ +!! html/parsoid +

+ + + +!! end + !! test Image with table with attributes in caption !! options @@ -18182,8 +18231,7 @@ HTML tag with leading space is parsed as text

!! end -## Don't expect Parsoid and PHP to match, since PHP isn't exactly following -## the HTML5 parsing spec. +## FIXME: The untrimmed attribute in Parsoid is T205737 !! test Element with broken attribute syntax !! options @@ -18192,7 +18240,7 @@ parsoid=wt2html
hi
ho
!! html/php -
hi
+
hi
ho
!! html/parsoid @@ -21526,7 +21574,6 @@ image:foobar.jpg|link=Main Page#section|caption !! end -## Whoops, Parsoid shouldn't be parsing templates in the attribute caption! !! test Gallery with template inside caption !! options @@ -21539,7 +21586,7 @@ File:Foobar.jpg|{{echo|ho}} !! html/php !! end +!! test +Gallery with wikitext inside gallery caption +!! wikitext + +File:Foobar.jpg|Image caption + +!! html/php + + +!! end + !! test Gallery with wikitext inside caption !! options @@ -22938,6 +23009,19 @@ language=zh variant=zh-tw

, not China

!! end +!! test +Explicit definition of language variant alternatives (BCP 47 codes) +!! options +language=zh variant=zh-tw +!! wikitext +-{zh:China;zh-Hant-TW:Taiwan}-, not China +!! html/php +

Taiwan, not China +

+!! html/parsoid +

, not China

+!! end + !! test Filter syntax for language variants !! options @@ -24429,7 +24513,7 @@ comment title=[[Main Page]] !! wikitext /* External links */ removed bogus entries !! html/php -→External links‎: removed bogus entries +→‎External links: removed bogus entries !!end !! test @@ -24439,7 +24523,7 @@ comment title=[[Main Page]] !! wikitext pre-comment text /* External links */ removed bogus entries !! html/php -pre-comment text →External links‎: removed bogus entries +pre-comment text →‎External links: removed bogus entries !!end !! test @@ -24449,9 +24533,29 @@ comment local title=[[Main Page]] !! wikitext /* External links */ removed bogus entries !! html/php -→External links‎: removed bogus entries +→‎External links: removed bogus entries !!end +!! test +Edit comment with section link that has a link in it +!! options +comment local title=[[Main Page]] +!! wikitext +/* [[A link]] */ +!! html/php +→‎[[A link]] +!! end + +!! test +Edit comment with section link that has a template in it +!! options +comment local title=[[Main Page]] +!! wikitext +/* {{foobar|param}} */ +!! html/php +→‎{{foobar|param}} +!! end + !! test Edit comment with subpage link (T16080) !! options @@ -24560,7 +24664,7 @@ title=[[Main Page]] !! wikitext /* __hello__world__ */ !! html/php -→__hello__world__‎ +→‎__hello__world__ !! end !! test @@ -28915,6 +29019,27 @@ Image: Invalid title as link

!! end +!! test +Various link types in alt and link options +!! wikitext +[[File:Foobar.jpg|link=[[Main Page]]|alt=[[Main Page]]|caption]] + +[[File:Foobar.jpg|link=[[Media:Thumb.png]]|alt=[[Media:Thumb.png]]|caption]] + +[[File:Foobar.jpg|link=[[wikipedia:Foo]]|alt=[[wikipedia:Foo]]|caption]] +!! html/php+tidy +

Main Page +

Media:Thumb.png +

wikipedia:Foo +

+!! html/parsoid +

Main Page

+ +

Media:Thumb.png

+ +

wikipedia:Foo

+!! end + !! test Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) !! options @@ -30931,6 +31056,170 @@ parsoid={ foo !! end +!! test +Ignore empty

when scrubWikitext is false +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html/parsoid +
1
+

a

b

+
2
+

a

+

+

b

+
3
+

a

+

+

+

+

+

b

+!! wikitext +
1
+a + +b +
2
+a + +b +
3
+a + +b +!! html/php+tidy +
1
+

a +

b +

+
2
+

a +

b +

+
3
+

a +

b +

+!! end + +!! test +Normalize empty paragraphs to HTML form that html2wt expects +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +
1
+

a

b

+
2
+

a

+

+

b

+
3
+

a

+

+

+

+

+

b

+
4
+

a

+

+
foo
+!! wikitext +
1
+a + + +b +
2
+a + + +b +
3
+a + + + + + +b +
4
+a + +
+
foo
+!! html/php+tidy +
1
+

a +


+b +

+
2
+

a +


+b +

+
3
+

a +


+


+

b +

+
4
+

a +


+

+
foo
+!! end + +!! test +Empty paragraphs (marked with mw-empty-elt) found in source should not be normalized away +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid + + + + + + + +
foo +
+

+
+!! wikitext +{| +|
foo +
+|+ +|} +!! end + +!! test +Templated content should be skipped over by normalization +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

foobar

foobar

+

+ +!! wikitext +{{SomeTemplate1|boo}}{{SomeTemplate2|booboo}} +!! end + !! test Escape nowiki DOM elements !! options