From: Subramanya Sastry Date: Tue, 8 Sep 2015 01:28:13 +0000 (-0500) Subject: Sync up with Parsoid parserTests. X-Git-Tag: 1.31.0-rc.0~10093^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=23e2f64ec56df0749dc36ea786c2146af159ad26 Sync up with Parsoid parserTests. This now aligns with Parsoid commit c8c7b5efa5a1754ec17294ee9e0269b3dfc9b0b1 Change-Id: I006cc95fb354c1b4ad40f0999938c5c4afaf099d --- diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9cada85c82..8f83fc6720 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6934,6 +6934,23 @@ foo !!end +!! test +Tables: Digest broken attributes on table and tr tag +!! options +parsoid=wt2html +!! wikitext +{| || |} ++ +|- || || ++ -- +|- > [ +|} +!! html + + + + +
+!! end + !! test Strip unsupported table tags !! options @@ -13838,9 +13855,9 @@ bar bar

!! end -## Edge case bug in Parsoid +## Edge case bugs in Parsoid from T93580 !! test -T93580: Templated inside images +T93580: 1. Templated inside block images !! wikitext [[File:Foobar.jpg|thumb|Caption with templated ref: {{echo|foo}}]] @@ -13851,6 +13868,30 @@ T93580: Templated inside images
  1. ↑ foo
!! end +!! test +T93580: 2. inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: foo]] + + +!! html/parsoid +

+ +
  1. ↑ foo
+!! end + +!! test +T93580: 3. Templated inside inline images +!! wikitext +[[File:Foobar.jpg|Undisplayed caption in inline image with ref: {{echo|{{echo|foo}}}}]] + + +!! html/parsoid +

+ +
  1. ↑ foo
+!! end + ### ### Subpages ### @@ -21889,23 +21930,23 @@ Empty TR nodes should not be stripped if they have any attributes set !! test Headings: 0. Unnested !! options -parsoid +parsoid=html2wt +!! html/parsoid +

=foo=

+ +

=foo= + +=foo=

+ +

=fooa=

!! wikitext =foo= - =foo= + =foo= =foo= =foo''a''= -!! html -

=foo=

- -

=foo= - -=foo=

- -

=fooa=

!!end # New headings and existing headings are handled differently @@ -21962,15 +22003,26 @@ parsoid=html2wt !! test Headings: 3. Nested inside html with wikitext split by html tags !! options -parsoid=html2wt,wt2wt -!! wikitext -= ='''bold'''foo= = +parsoid=html2wt !! html/parsoid

=boldfoo=

+!! wikitext += ='''bold'''foo= = !!end !! test Headings: 4a. No escaping needed (testing just h1 and h2) +!! options +parsoid=html2wt +!! html/parsoid +

=foo

+

foo=

+

=foo=

+

=foo= bar

+

=foo

+

foo=

+

=

+

=foo=

!! wikitext = =foo = @@ -21987,15 +22039,6 @@ Headings: 4a. No escaping needed (testing just h1 and h2) = = = = ''=''foo= = -!! html/parsoid -

=foo

-

foo=

-

=foo=

-

=foo= bar

-

=foo

-

foo=

-

=

-

=foo=

!!end !! test @@ -22015,6 +22058,20 @@ parsoid=html2wt !! test Headings: 5. Empty headings +!! options +parsoid=html2wt +!! html/parsoid +

+ +

+ +

+ +

+ +
+ +
!! wikitext == @@ -22027,112 +22084,74 @@ Headings: 5. Empty headings ========== ============ -!! html/parsoid -

- -

- -

- -

- -
- -
!!end !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) +!! options +parsoid=html2wt +!! html/parsoid +

=a=

+ +

=a=

+ +

=a=

!! wikitext =a= =a= =a= - -=a= -!! html/php -

=a= -

=a= -

=a= -

=a= -

-!! html/parsoid -

=a=

- -

=a=

- -

=a=

- -

=a=

!!end !! test Headings: 6b. Heading chars in SOL context (with trailing newlines) -!! wikitext -=a= -b - -=a= -b +!! options +parsoid=html2wt +!! html/parsoid +

=a= +b

-=a= -b +

=a= +b

-=a= -b -!! html/php -

=a= -b -

=a= -b -

=a= -b -

=a= +

=a= +b

+!! wikitext +=a= b -

-!! html/parsoid -

=a= -b

-

=a= -b

- -

=a= -b

+=a= +b -

=a= -b

+=a= +b !!end !! test Headings: 6c. Heading chars in SOL context (leading newline break) +!! options +parsoid=html2wt +!! html/parsoid +

a +=b=

!! wikitext a =b= -!! html/php -

a -=b= -

-!! html/parsoid -

a -=b= !!end !! test Headings: 6d. Heading chars in SOL context (with interspersed comments) +!! options +parsoid=html2wt +!! html/parsoid +

=a=

+ +

=a=

!! wikitext =a= =a= -!! html/php -

=a= -

=a= -

-!! html/parsoid -

=a=

- -

=a=

!!end !! test @@ -22176,27 +22195,36 @@ a !! test Lists: 0. Outside nests +!! options +parsoid=html2wt +!! html/parsoid +

*foo

+ +

#foo

+ +

;Foo:bar

!! wikitext *foo #foo -;Foo:bar -!! html/php -

*foo -

#foo -

;Foo:bar -

-!! html/parsoid -

*foo

- -

#foo

- -

;Foo:bar

+;Foo:bar !!end !! test Lists: 1. Nested inside html +!! options +parsoid=html2wt +!! html/parsoid +
  • *foo
+
  • #foo
+
  • :foo
+
  • ;foo
+
  1. *foo
+
  1. #foo
+
  1. :foo
+
  1. ;foo
+ !! wikitext **foo @@ -22213,20 +22241,19 @@ Lists: 1. Nested inside html #:foo #;foo -!! html -
  • *foo
-
  • #foo
-
  • :foo
-
  • ;foo
-
  1. *foo
-
  1. #foo
-
  1. :foo
-
  1. ;foo
- !!end !! test Lists: 2. Inside definition lists +!! options +parsoid=html2wt +!! html/parsoid +
;foo
+
:foo
+
:foo
+
bar
+
:foo
+ !! wikitext ;;foo @@ -22236,40 +22263,27 @@ Lists: 2. Inside definition lists :bar ::foo -!! html -
;foo
-
:foo
-
:foo
-
bar
-
:foo
- !!end !! test Lists: 3. Only bullets at start of text should be escaped +!! options +parsoid=html2wt +!! html/parsoid +
  • *foo*bar
+
  • *fooit*bar
+ !! wikitext **foo*bar **foo''it''*bar -!! html -
  • *foo*bar
-
  • *fooit*bar
- !!end !! test Lists: 4. No escapes needed !! options -parsoid -!! wikitext -*foo*bar - -*''foo''*bar - -*[[Foo]]: bar - -*[[Foo]]*bar -!! html +parsoid=html2wt +!! html/parsoid
  • foo*bar
  • @@ -22286,10 +22300,29 @@ parsoid
  • Foo*bar
+!! wikitext +*foo*bar + +*''foo''*bar + +*[[Foo]]: bar + +*[[Foo]]*bar !!end !! test Lists: 5. No unnecessary escapes +!! options +parsoid=html2wt +!! html/parsoid +
  • bar [[foo]]
+
  • =bar [[foo]]
+
  • [[bar [[foo]]
+
  • ]]bar [[foo]]
+
  • =bar foo]]=
+
  • : a
+
  • * foo
+ !! wikitext * bar [[foo]] @@ -22304,15 +22337,6 @@ Lists: 5. No unnecessary escapes * : a * ''* foo'' -!! html -
  • bar [[foo]]
-
  • =bar [[foo]]
-
  • [[bar [[foo]]
-
  • ]]bar [[foo]]
-
  • =bar foo]]=
-
  • : a
-
  • * foo
- !!end !! test @@ -22327,13 +22351,15 @@ parsoid=html2wt !! test Lists: 7. Escape bullets in a multi-line context -!! wikitext -a -*b -!! html +!! options +parsoid=html2wt +!! html/parsoid

a *b

+!! wikitext +a +*b !!end !! test @@ -22352,17 +22378,16 @@ parsoid=html2wt !! test HRs: 1. Single line +!! options +parsoid=html2wt +!! html/parsoid +
---- +
=foo= +
*foo !! wikitext -------- ----=foo= ----*foo -!! html+tidy -
-

----

-
-

=foo=

-
-

*foo

!! end #### --------------- Tables --------------- @@ -22386,40 +22411,48 @@ HRs: 1. Single line !! test Tables: 1a. Simple example -!! wikitext -{| -|} -!! html +!! options +parsoid=html2wt +!! html/parsoid

{| |}

+!! wikitext +{| +|} !! end !! test Tables: 1b. No escaping needed -!! wikitext -!foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

!foo

+!! wikitext +!foo !! end !! test Tables: 1c. No escaping needed -!! wikitext -|foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

|foo

+!! wikitext +|foo !! end !! test Tables: 1d. No escaping needed -!! wikitext -|}foo -!! html +!! options +parsoid=html2wt +!! html/parsoid

|}foo

+!! wikitext +|}foo !! end !! test @@ -22480,11 +22513,8 @@ parsoid=html2wt !! test Tables: 2c. Nested in td -- no escaping needed -!! wikitext -{| - -|foo!!bar -|} +!! options +parsoid=html2wt !! html/* @@ -22492,15 +22522,17 @@ Tables: 2c. Nested in td -- no escaping needed
foo!!bar
-!! end - -!! test -Tables: 3a. Nested in th !! wikitext {| -!foo!bar +|foo!!bar |} +!! end + +!! test +Tables: 3a. Nested in th +!! options +parsoid=html2wt !! html/* @@ -22508,6 +22540,11 @@ Tables: 3a. Nested in th
foo!bar
+!! wikitext +{| + +!foo!bar +|} !! end !! test @@ -22616,6 +22653,19 @@ parsoid=html2wt !! test Tables: 4c. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + + +
foo-barfoo+bar
foo-barfoo+bar
foo +

bar|baz ++bar +-bar

x +
a|b
!! wikitext {| |foo-bar @@ -22656,21 +22706,18 @@ bar|baz
a|b
-!! html/parsoid - - - - - -
foo-barfoo+bar
foo-barfoo+bar
foo -

bar|baz -+bar --bar

x -
a|b
!! end !! test Tables: 4d. No escaping needed +!! options +parsoid=html2wt +!! html/parsoid + + + + +
Foo-bar+1-2
!! wikitext {| |[[Foo]]-bar @@ -22687,29 +22734,6 @@ Tables: 4d. No escaping needed -2 -!! html/parsoid - - - - -
Foo-bar+1-2
-!! end - -!! test -Tables: Digest broken attributes on table and tr tag -!! options -parsoid=wt2html -!! wikitext -{| || |} ++ -|- || || ++ -- -|- > [ -|} -!! html - - - - -
!! end !! test @@ -22726,6 +22750,13 @@ parsoid=html2wt !! test Unclosed xmlish element in table line shouldn't eat end delimiters +!! options +parsoid=html2wt +!! html/parsoid + + + +
<foo bar>
!! wikitext {| | bar> -!! html/parsoid - - - -
<foo bar>
!! end #### --------------- Links ---------------- @@ -22755,6 +22781,12 @@ Unclosed xmlish element in table line shouldn't eat end delimiters #### -------------------------------------- !! test Links 1. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

Fooboo +[Foobar] +x [Foobar] x

!! wikitext [[Foo|Foo''boo'']] [[Foo|[Foobar]]] @@ -22764,10 +22796,6 @@ Links 1. WikiLinks: No escapes needed [Foobar] x [Foobar] x

-!! html/parsoid -

Fooboo -[Foobar] -x [Foobar] x

!! end !! test @@ -22812,6 +22840,11 @@ parsoid=html2wt !! test Links 3. WikiLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

[Foobar +foo|bar

!! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] @@ -22819,9 +22852,6 @@ Links 3. WikiLinks: No escapes needed

[Foobar foo|bar

-!! html/parsoid -

[Foobar -foo|bar

!! end !! test @@ -22851,17 +22881,21 @@ parsoid=html2wt !! test Links 5. ExtLinks: No escapes needed +!! options +parsoid=html2wt +!! html/parsoid +

[google

!! wikitext [http://google.com [google] !! html/php

[google

-!! html/parsoid -

[google

!! end !! test Links 6. Add s between text-nodes and url-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

xhttp://example.comy http://example.com?x @@ -22895,6 +22929,8 @@ http://example.com(x) !! test Links 7a. Don't add spurious s between text-nodes and url-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

x http://example.com @@ -22928,6 +22964,8 @@ y !! test Links 7b. Don't add spurious s between text-nodes and url-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

http://example.com.,;:!?\ -http://example.com:

@@ -22942,6 +22980,8 @@ http://example.com.,;:!?\ !! test Links 8. Add s between text-nodes and RFC-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

RFC 1234 RFC 123y @@ -22954,6 +22994,8 @@ XRFC 123y !! test Links 9. Don't add spurious s between text-nodes and RFC-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

RFC 123?foo RFC 123&foo @@ -22972,6 +23014,8 @@ RFC 123&foo !! test Links 10. Add s between text-nodes and PMID-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

PMID 1234 PMID 123y @@ -22984,6 +23028,8 @@ XPMID 123y !! test Links 11. Don't add spurious s between text-nodes and PMID-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

PMID 123?foo PMID 123&foo @@ -23002,6 +23048,8 @@ PMID 123&foo !! test Links 12. Add s between text-nodes and ISBN-links when required (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

ISBN 12345678901 ISBN 1234567890x @@ -23015,6 +23063,8 @@ aISBN 1234567890b !! test Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300) +!! options +parsoid=html2wt !! html/parsoid

-ISBN 1234567890's !! wikitext @@ -23039,13 +23089,14 @@ parsoid=html2wt Links 15. Link trails can't become link prefixes. !! options language=is +parsoid=html2wt +!! html/parsoid +

Söfnuður-00

!! wikitext [[Söfnuður]]-[[00]] !! html/php

Söfnuður-00

-!! html/parsoid -

Söfnuður-00

!! end #### --------------- Quotes --------------- @@ -23057,28 +23108,7 @@ language=is !! test 1a. Quotes inside and !! options -parsoid=html2wt,wt2wt -!! wikitext -'''foo''' -''''foo'''' -'''''foo''''' -''foo'''s -''''foo'''' -'''''foo''''' -''''''foo'''''' -'''foo'''bar'''baz''' -'''foo''''s -'''foo'' -''foo''' -''foo'''' -'''foo''' -''''foo''' -'''foo'''' -''''foo'''' -''fools' errand'' -''fool's errand'' -'''foo'' bar '''baz'' -a|!*#-:;+-~[]{}b'''x'' +parsoid=html2wt !! html/*

'foo' ''foo'' @@ -23101,22 +23131,34 @@ a|!*#-:;+-~[]{}b'''x'' 'foo bar 'baz a|!*#-:;+-~[]{}b'x

+!! wikitext +'''foo''' +''''foo'''' +'''''foo''''' +''foo'''s +''''foo'''' +'''''foo''''' +''''''foo'''''' +'''foo'''bar'''baz''' +'''foo''''s +'''foo'' +''foo''' +''foo'''' +'''foo''' +''''foo''' +'''foo'''' +''''foo'''' +''fools' errand'' +''fool's errand'' +'''foo'' bar '''baz'' +a|!*#-:;+-~[]{}b'''x'' !! end !! test 1b. Quotes inside and with other tags on same line !! options -parsoid=html2wt,wt2wt -!! wikitext -'''a'' foo ''[[bar]]'' -''a''' foo ''[[bar]]'' -''a''' foo '''{{echo|[[bar]]}}''' -[[foo]] x'''[[bar]]'' -'''foo'' test -'''foo''
test
-'''foo'' and
bar - -!! html +parsoid=html2wt +!! html/parsoid 'a foo bar a' foo bar a' foo bar @@ -23127,45 +23169,58 @@ parsoid=html2wt,wt2wt
  1. ↑ test
+!! wikitext +'''a'' foo ''[[bar]]'' +''a''' foo ''[[bar]]'' +''a''' foo '''{{echo|[[bar]]}}''' +[[foo]] x'''[[bar]]'' +'''foo'' test +'''foo''
test
+'''foo'' and
bar + !! end !! test 2. Link fragments separated by and tags +!! options +parsoid=html2wt +!! html/parsoid +

[[foohello]]

+

[[foohello]]

!! wikitext [[''foo''hello]] [['''foo'''hello]] -!! html -

[[foohello]] -

[[foohello]] -

!! end # FIXME: Escaping one or both of [[ and ]] is also acceptable -- # this is one of the shortcomings of this format !! test 3. Link fragments inside and +!! options +parsoid=html2wt +!! html/parsoid +

[[foo]]

+

[[foo]]

!! wikitext ''[[foo'']] '''[[foo''']] -!! html -

[[foo]] -

[[foo]] -

!! end !! test 4. No escaping needed -!! wikitext -'''bar''' -''''bar'''' -'a:b'foo -!! html +!! options +options=html2wt +!! html/parsoid

'bar' 'bar' 'a:b'foo

+!! wikitext +'''bar''' +''''bar'''' +'a:b'foo !! end #### ----------- Paragraphs --------------- @@ -23174,6 +23229,15 @@ parsoid=html2wt,wt2wt !! test 1. No unnecessary escapes +!! options +parsoid=html2wt +!! html/parsoid +

bar [[foo]] +

=bar [[foo]] +

[[bar [[foo]] +

]]bar [[foo]] +

=bar foo]]= +

!! wikitext bar [[foo]] @@ -23184,13 +23248,6 @@ bar [[foo]] ]]bar [[foo]] =bar foo]]= -!! html -

bar [[foo]] -

=bar [[foo]] -

[[bar [[foo]] -

]]bar [[foo]] -

=bar foo]]= -

!!end #### ----------------------- PRE -------------------------- @@ -23199,20 +23256,7 @@ bar [[foo]] !! test 1. Leading whitespace in SOL context should be escaped !! options -parsoid=html2wt,wt2wt -!! html/php -

a -

a -

a(tab) -

a - a -

a - b -

a - b -

a - b -

+parsoid=html2wt !! html/parsoid

a

@@ -23251,51 +23295,64 @@ a a b +!! html/php +

a +

a +

a(tab) +

a + a +

a + b +

a + b +

a + b +

!! end !! test 2. Leading whitespace in non-indent-pre contexts should not be escaped !! options -parsoid -!! wikitext -foo ''a'' - b - -!! html +parsoid=htm2wt +!! html/parsoid

foo [1]

  1. ↑ a b
+!! wikitext +foo ''a'' + b + !! end !! test 3. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options -parsoid -!! wikitext +parsoid=html2wt +!! html/parsoid
+

a b - c + c

-!! html +!! wikitext
-

a b - c

+ c
!! end !! test 4. Leading whitespace in indent-pre suppressing contexts should not be escaped !! options -parsoid -!! wikitext - [[File:Foobar.jpg|thumb|caption]] +options=html2wt !! html/parsoid
caption
+!! wikitext + [[File:Foobar.jpg|thumb|caption]] !! end !! test @@ -23311,15 +23368,15 @@ parsoid=html2wt !!test T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block !! options -parsoid -!! wikitext - * foo - * bar -!! html +parsoid=html2wt +!! html/parsoid
 * foo
 * bar
 
+!! wikitext + * foo + * bar !! end #### --------------- Behavior Switches -------------------- @@ -23351,15 +23408,8 @@ __|__ # We use indent-pre as an indirect way to test for sol-transparent behavior. !! test Behavior switches should be SOL-transparent -!! wikitext - __TOC__ - - - __TOO__ - - __TOC__ foo - -__TOC__ bar +!! options +parsoid=html2wt !! html/parsoid @@ -23369,6 +23419,15 @@ __TOC__ bar
 foo
bar
+!! wikitext + __TOC__ + + + __TOO__ + + __TOC__ foo + +__TOC__ bar !! end #### --------------- HTML tags --------------- @@ -23380,75 +23439,85 @@ __TOC__ bar !! test 1. a tags !! options -parsoid +parsoid=html2wt +!! html/parsoid +<a href="http://google.com">google</a> !! wikitext google -!! html -<a href="http://google.com">google</a> !! end !! test 2. other tags -!! wikitext -*
foo
-*
foo
-* -!! html +!! options +parsoid=html2wt +!! html/parsoid
  • <div>foo</div>
  • <div style="color:red">foo</div>
  • <td>
+!! wikitext +*
foo
+*
foo
+* !! end !! test 3. multi-line html tag -!! wikitext -
foo
-!! html +!! options +parsoid=html2wt +!! html/parsoid

<div >foo</div >

+!! wikitext +
foo
!! end !! test 4. extension tags +!! options +parsoid=html2wt +!! html/parsoid +

<ref>foo</ref> +

<ref>bar +

baz</ref> +

!! wikitext foo bar baz
-!! html -

<ref>foo</ref> -

<ref>bar -

baz</ref> -

!! end #### --------------- Others --------------- !! test Escaping nowikis -!! wikitext -<nowiki>foo</nowiki> -!! html +!! options +parsoid=html2wt +!! html/parsoid

<nowiki>foo</nowiki>

+!! wikitext +<nowiki>foo</nowiki> !! end ## The quote-char in the input is necessary for triggering the bug !! test (Bug 52035) Nowiki-escaping should not get tripped by " :" in text !! options -parsoid=wt2wt,html2wt +parsoid=html2wt +!! html/parsoid +

foo's bar :

!! wikitext foo's bar : -!! html -

foo's bar :

!! end +#----------- End of wikitext escaping tests -------------- + !! test Tag-like HTML structures are passed through as text