From acab3167f89b62fdb3a988ad1a6f67537b9fd59c Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Mon, 16 Jul 2018 18:56:16 -0400 Subject: [PATCH] Sync up with Parsoid parserTests.txt This now aligns with Parsoid commit d473791ea982178af7a0fe15aff5cf8e21aaa5e8 Change-Id: Ide8a0d8df20242c9e60e40db653368ba3ef7a06c --- tests/parser/parserTests.txt | 326 ++++++++++++++++++++--------------- 1 file changed, 185 insertions(+), 141 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 32542711aa..e2da66282e 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1394,7 +1394,7 @@ Non-word characters don't terminate tag names (T19663, T42670, T54022) doesn't terminate -!! html +!! html/php

<blockquote|>a</blockquote>

<b→> doesn't terminate </b→>

<bä> doesn't terminate </bä> @@ -1457,12 +1457,10 @@ parsoid=wt2html s -!! html/php+tidy +!! html+tidy

<s.foo>s

-!! html/parsoid -

<s.foo>s

!! end ### @@ -2021,22 +2019,18 @@ a
foo

!! end -# Remex wraps empty tag runs with p-tags. -# Parsoid strips them out during p-wrapping. !! test No p-wrappable content +!! options +parsoid=wt2html,html2html !! wikitext
x
x
x
-!! html/php+tidy +!! html+tidy
x
x

x
-!! html/parsoid -
x
-
x
-
x
!! end # T177612: Parsoid-only test @@ -2052,6 +2046,8 @@ x !! test Block tag on one line (
) +!! options +parsoid=wt2html,html2html !! wikitext a
foo
@@ -2083,6 +2079,8 @@ b

foo
!! test Block tag on both lines (
) +!! options +parsoid=wt2html,html2html !! wikitext a
foo
@@ -2122,12 +2120,6 @@ x

foo

z

!! end -# The difference between Parsoid & Remex here -# is because of Parsoid's Tidy-emulation code -# for p-wrapping. We'll start work to remove this -# emulation code in Parsoid sooner than later. -# Remex wraps empty tag runs with p-tags. -# Parsoid strips them out in a separate pass. !! test Empty lines between lines with block tags !! wikitext @@ -2349,6 +2341,22 @@ hi

!! end +!! test +Dangling table row doesn't prevent p-wrapping +!! options +parsoid=wt2html,html2html +!! wikitext +{| +| hi +|- +|} ho +!! html/parsoid + + + +
hi

ho

+!! end + ### ### Preformatted text ### @@ -2486,6 +2494,8 @@ Bar !! test T17491: / in blockquote +!! options +parsoid=wt2html !! wikitext
Foo bar baz quux @@ -2505,6 +2515,8 @@ Foo bar baz quux !! test T17491: / in blockquote (2) +!! options +parsoid=wt2html !! wikitext
Foo bar baz quux
@@ -2838,6 +2850,7 @@ Barack Obama of the United States

!! end +## Remex doesn't account for fostered content. !! test Handle broken pre-like tags (T66025) !! options @@ -2856,7 +2869,7 @@ parsoid=wt2html !! html/parsoid
x
-<pre
+

<pre

!! end !! test @@ -3518,8 +3531,10 @@ parsoid=wt2html,html2html !! end -!!test +!! test 3a. Indent-Pre and block tags (single-line html) +!! options +parsoid=wt2html,html2html !! wikitext a

foo

b
foo
@@ -3531,18 +3546,17 @@ parsoid=wt2html,html2html c
foo
 foo 
 
-!! html/parsoid -

a

foo

-

b

foo
-

c

foo
-
 foo 
-
!! html/php+tidy

a

foo

b

foo

c

foo

 foo 
 
+!! html/parsoid +

a

foo

+ b

foo

+ c

foo

+
 foo 
!! end !! test @@ -3630,17 +3644,17 @@ foo !! test 4. Indent-Pre and extension tags +!! options +parsoid=wt2html,html2html !! wikitext a -!! html/php - a
-NULL
+!! html/php+tidy
+

a

NULL
 array (
 )
 
- !! html/parsoid - a

+

a


 !! end
 
 !! test
@@ -6851,7 +6865,7 @@ parsoid=wt2html,html2html
 

ho">ha</div>

!! html/parsoid -ho">ha +

ho">ha

!! end !! test @@ -7313,10 +7327,11 @@ Wikitext table with html-syntax row foo !! end +## Remex doesn't account for fostered content. !! test Fostered content in tables: Plain text !! options -parsoid=wt2html,html2html +parsoid=wt2html !! wikitext {| |- @@ -7334,9 +7349,9 @@ a a
!! html/parsoid - -a - +

+a

+
!! end @@ -10150,6 +10165,8 @@ Unbalanced closing block tags break a list !! test Unbalanced closing non-block tags don't break a list +!! options +parsoid=wt2html,html2html !! wikitext *a @@ -10160,12 +10177,9 @@ Unbalanced closing non-block tags don't break a list
  • a
  • b
!! html/parsoid - -
    -
  • a
  • -
  • b
  • -
-
+

+
  • a
  • +
  • b
!! end # Parsoid does some post-dom-building cleanup @@ -10186,14 +10200,7 @@ parsoid=wt2html,wt2wt,html2html !! end # Output is ugly because of all the misnested tag fixups. -# Remex is wrapping p-tags around empty elements. -# Parsoid has special-case handling of this pattern of -# wrapping lists in formatting tags. -# FIXME: Should we remove this code from Parsoid? Or add -# special support in Remex? If the latter, maybe just wait -# for Parsoid to become the default parser. -# See T70395. -!!test +!! test 1. List embedded in a formatting tag !! wikitext @@ -10204,17 +10211,13 @@ parsoid=wt2html,wt2wt,html2html

  • foo

!! html/parsoid - -
    -
  • foo
  • -
-
-!!end +

+
  • foo
+

+!! end -# Output is ugly because of all the misnested tag fixups -# Remex is wrapping p-tags around empty elements. -# Parsoid has code that strips useless p-tags. -!!test +# Output is ugly because of all the misnested tag fixups. +!! test 2. List embedded in a formatting tag in a misnested way !! wikitext @@ -10225,13 +10228,10 @@ parsoid=wt2html,wt2wt,html2html

  • a
  • b
!! html/parsoid - -
    -
  • a
  • -
    -
  • b
  • -
-!!end +

+
  • a
  • +
  • b
+!! end ### ### Magic Words @@ -12918,10 +12918,7 @@ Templates: Block Tags: 2. Back-to-back template uses !!end -## This is an edge case relating to paragraph wrapping. -## Note that Parsoid fails to match Remex because it's using the closing tag -## as a heuristic to determine if it's in a block, rather than SAX based events. -## And Parsoid drops empty elements in templates. +## Parsoid drops empty elements in templates. !! test Templates: Correctly encapsulate templates producing

tag without a corresponding

tag !! wikitext @@ -12933,7 +12930,7 @@ b

}} b

!! html/parsoid

a

-b +

b

!! end !!test @@ -13303,6 +13300,7 @@ parsoid=wt2html,wt2wt
foo
!!end +## Remex doesn't account for fostered content. !! test Templates: Wiki Tables: 1a. Fostering of entire template content !! wikitext @@ -13319,7 +13317,7 @@ a a
!! html/parsoid -a +

a

!! end @@ -13355,6 +13353,7 @@ foo !! end +## Remex doesn't account for fostered content. !! test Templates: Wiki Tables: 2. Fostering of partial template content !! wikitext @@ -13374,7 +13373,7 @@ a
b
!! html/parsoid -a
b
+

a

b
@@ -13438,20 +13437,20 @@ Templates: Wiki Tables: 6. Templated tags, templated td-tags ## a marker tag for tags and they are expanded ## much later. We are verifying that this tag usage ## doesn't prevent foster parenting. -!!test +!! test Templates: Wiki Tables: 7. Fosterable s should get fostered -!!wikitext +!! wikitext {{PartialTable}}foo |} -!!html/parsoid -[1] +!! html/parsoid +

[1]

-
  1. ↑ foo
-!!end +
  1. ↑ foo
+!! end !! test Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered @@ -14579,8 +14578,8 @@ thumbsize=220

!! html/parsoid

123456

-

123

456

-

123

456

+

123

456 +123

456

!! end !! test @@ -17730,6 +17729,8 @@ Media link with text # Parsoid & Remex fix the p-wrapping since they operate on the DOM. !! test Media link with nasty text +!! options +parsoid=wt2html,html2html !! wikitext [[Media:Foobar.jpg|Safe Link
" onmouseover="alert(document.cookie)" onfoo="
]] !! html/php @@ -17738,8 +17739,7 @@ Media link with nasty text !! html/php+tidy

Safe Link

" onmouseover="alert(document.cookie)" onfoo="
!! html/parsoid -

Safe Link

- +

Safe Link

" onmouseover="alert(document.cookie)" onfoo="
!! end !! test @@ -18453,6 +18453,8 @@ array ( !! test Parser hook: nested tags +!! options +parsoid=wt2html !! wikitext !! html/php @@ -18462,8 +18464,14 @@ array ( )
</tag> +!! html/php+tidy +
''
+array (
+)
+

</tag> +

!! html/parsoid -
</tag>
+

</tag>

!! end !! test @@ -18539,7 +18547,7 @@ array ( text !! html/parsoid -
text
+

text

!! end ##
should be output literally since there is no matching tag that begins it @@ -18671,8 +18679,6 @@ Nested template calls ### Sanitizer ### -# Remex wraps empty tag runs with p-tags. -# Parsoid strips them out during p-wrapping. !! test Sanitizer: Closing of open tags !! wikitext @@ -18680,7 +18686,7 @@ Sanitizer: Closing of open tags !! html/php+tidy

!! html/parsoid -
+

!! end !! test @@ -18698,10 +18704,9 @@ Sanitizer: Closing of closed but not open tags parsoid=wt2html !! wikitext -!! html/php+tidy +!! html+tidy

-!! html/parsoid !! end !! test @@ -19278,7 +19283,8 @@ http://===r:::https://b !! end -# Known to produce bad XML for now +## Remex doesn't account for fostered content. +## Known to produce bad XML for now !! test Fuzz testing: Parser24 !! options @@ -19305,14 +19311,27 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT -!! html/parsoid -

{{{| -}}}} > -

MOVE YOUR MOUSE CURSOR OVER THIS TEXT

+!! html/php+tidy +{{{| +}}}} > +
+MOVE YOUR MOUSE CURSOR OVER THIS TEXT +
+ + +
+

+

+!! html/parsoid +

+{{{| +}}}} > +
- +MOVE YOUR MOUSE CURSOR OVER THIS TEXT

+
!! end # Note: the current result listed for this is not what the original one was, @@ -19504,6 +19523,10 @@ New wiki paragraph

Bold paragraph

New wiki paragraph

+!! html/php+tidy +

Bold paragraph +

New wiki paragraph +

!! html/parsoid

Bold paragraph

New wiki paragraph @@ -20453,7 +20476,7 @@ parsoid=wt2html ''''' !! html/php !! html/parsoid - +

!! end # same html as previous, but wikitext adjusted to match parsoid html2wt @@ -22807,11 +22830,11 @@ language=zh variant=zh-cn ad !! html/parsoid -

a

d

+a
d -

a

d

+a
d -

ad

+

ad

!! end !! test @@ -23095,10 +23118,8 @@ language=zh variant=zh-cn
-{zh-cn:AAA

!! html/parsoid -
foo:bar
-
-{zh-cn
-
AAA
-
+
foo:bar
+
-{zh-cn
AAA
!! end !! test @@ -23463,7 +23484,6 @@ Line two !! end # doBlockLevels screws up this output and Remex cleans up as much as it can. -# Parsoid seems to do a better job here since its p-wrapper is probably smarter. !! test Nesting tags, paragraphs on lines which begin with
!! wikitext @@ -23474,15 +23494,15 @@ B

B

!! html/parsoid -
-

A -B -

+

A

+

B

!! end # T8200:
should behave like
with respect to line breaks !! test T8200: paragraphs inside blockquotes (no extra line breaks) +!! options +parsoid=wt2html,html2html !! wikitext
Line one @@ -23498,6 +23518,8 @@ Line two

!! test T8200: paragraphs inside blockquotes (extra line break on open) +!! options +parsoid=wt2html,html2html !! wikitext
Line one @@ -23516,9 +23538,10 @@ Line two
Line two

!! end -# Parsoid's output is broken on this because of Tidy-compatibility cruft !! test T8200: paragraphs inside blockquotes (extra line break on close) +!! options +parsoid=wt2html,html2html !! wikitext
Line one @@ -24514,7 +24537,7 @@ __TOC__

Quote

[edit]

!! html/parsoid -

Quote

+

Quote

!! end !! test @@ -24578,7 +24601,7 @@ __TOC__

Foo Bar

-

Foo
Bar

+

Foo

Bar

!! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to @@ -25028,13 +25051,13 @@ parsoid=wt2html,wt2wt #### Parsoid-specific functionality tests #### ----------------------------------------------------------------- -# T65642/T68749: Formatting elt fixup around images is cleaned up. +# T65642/T68749: Formatting elt fixup around images. # We know wt2wt will fail, but we expect selser to pass. # Due to the nature of our testing, wt2wt and selser tests will enter the # blacklist and we'll catch selser regressions based on changes to the # blacklist entries for selser tests. !! test -1. Bad treebuilder fixup of formatting elt is cleaned up +1. Treebuilder fixup of formatting elt !! options parsoid=wt2html,wt2wt !! wikitext @@ -25044,50 +25067,63 @@ parsoid=wt2html,wt2wt [[Image:Foobar.jpg|right|Test]] |} +!! html/php+tidy + + +
+

+

+
Test
+

+

+
!! html/parsoid +

+
Test
+

- -
Test
-
-
!! end !! test -2. Bad treebuilder fixup of formatting elt is cleaned up +2. Treebuilder fixup of formatting elt !! options parsoid=wt2html,wt2wt !! wikitext '''foo[[File:Foobar.jpg|thumb|caption]]bar''' [[Image:Foobar.jpg|right|300px]] +!! html/php+tidy +

foo

caption

bar +

Foobar.jpg
!! html/parsoid +

foo

caption

bar

-

foo

-
caption
-

bar

!! end !! test -3. Bad treebuilder fixup of formatting elt is cleaned up +3. Treebuilder fixup of formatting elt !! options parsoid=wt2html,wt2wt !! wikitext '''foo[[File:Foobar.jpg|thumb|caption]]bar''' +!! html/php+tidy +

foo

caption

bar +

!! html/parsoid -

foo

-
caption
-

bar

+

foo

caption

bar

!! end !! test -4. Bad treebuilder fixup of formatting elt is cleaned up: formatting tags around captionless images are ignored +4. Treebuilder fixup of formatting elt: formatting tags around captionless images !! options parsoid=wt2html,wt2wt !! wikitext '''[[Image:Foobar.jpg|right|300px]]''' +!! html/php+tidy +
Foobar.jpg
!! html/parsoid
!! end @@ -27433,16 +27469,17 @@ Encapsulate protected attributes from wt ## Currently the p-wrapper is fragile in how it adds / removes transformations. ## Having nested or stray pre tags results in the attempt to add duplicates, ## causing an assertion fail. This test tries to prevent that situation. -!!test +!! test Ensure ParagraphWrapper can deal with stray closing pre tags -!!options +!! options parsoid=wt2html !! wikitext plain text !! html/parsoid -plain text -!!end +

plain text

+!! end +## Remex doesn't account for fostered content. !! test 1. Ensure fostered text content is wrapped in element nodes !! options @@ -27452,9 +27489,10 @@ parsoid=wt2html !! html/php+tidy hi
ho
!! html/parsoid -hi
ho
+

hi

ho

!! end +## Remex doesn't account for fostered content. !! test 2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost) !! options @@ -27470,12 +27508,13 @@ parsoid=wt2html,wt2wt a !! html/parsoid - || || - +

|| ||

+
a
!! end +## Remex doesn't account for fostered content. !! test Encapsulation properly handles null DSR information from foster box !! options @@ -27483,9 +27522,10 @@ parsoid=wt2html,wt2wt !! wikitext {{echo|foo
bar
}} !! html/parsoid -foo
bar
+

foo

bar
!! end +## Remex doesn't account for fostered content. !! test 1. Encapsulate foster-parented transclusion content !! options @@ -27495,7 +27535,7 @@ parsoid=wt2wt,wt2html !! html/php+tidy foo
bar
!! html/parsoid -foo
bar
+

foo

bar
!! end !! test @@ -27553,6 +27593,7 @@ parsoid=wt2wt,wt2html !! end +## Remex doesn't account for fostered content. !! test 5. Encapsulate foster-parented transclusion content !!options @@ -27562,9 +27603,10 @@ parsoid=wt2wt,wt2html !! html/php+tidy foo

foo

!! html/parsoid -foo

foo

+

foo

foo

!! end +## Remex doesn't account for fostered content. !! test 6. Encapsulate foster-parented transclusion content !! options @@ -27574,7 +27616,7 @@ parsoid=wt2wt,wt2html !! html/php+tidy foo

foo

ok

!! html/parsoid -foo

foo

ok

+

foo

foo

ok

!! end !! test @@ -27594,6 +27636,7 @@ parsoid=wt2wt,wt2html !! end +## Remex doesn't account for fostered content. # Note that the wt is broken on purpose: the = should be {{=}} if you # don't want it to be a template parameter key. !! test @@ -27616,12 +27659,13 @@ parsoid=wt2wt,wt2html !! html/parsoid

a

-{{{1}}} +

{{{1}}}

b
!! end +## Remex doesn't account for fostered content. !! test 9. Encapsulate foster-parented transclusion content !!options @@ -27632,7 +27676,7 @@ parsoid=wt2wt,wt2html hi

hello

!! html/parsoid -hi

hello

+

hi

hello

!! end !! test @@ -31377,7 +31421,7 @@ __NOTOC__
-
Table Cell 1Table Cell 2

foo

+ foo !! end # Looks like is not accepted in HTML -- 2.20.1