From 9cd247643abf6ef5d5b3bf7bdab1381bb1f83f00 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Mon, 20 Oct 2014 18:06:41 -0500 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 9c8b75a3950eb1e1085ff140e76f69d70e25a647 Change-Id: I34b7077262e006acb9d45dd734488292ce9d4912 --- tests/parser/parserTests.txt | 1237 +++++++++++++++++++++------------- 1 file changed, 761 insertions(+), 476 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index c90c4f6b77..8dfb4dd143 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -155,6 +155,39 @@ Template:OpenTable {| !!endarticle +!!article +Template:EmptyLITest +!!text +*a +* +* +*b +!!endarticle + +!!article +Template:EmptyTRTest +!!text +{| +|- +|- +|foo +|- +|- +|bar +|} +!!endarticle + +!!article +Template:EmptyTRWithHTMLAttrTest +!!text + + + + + +
foo
bar
+!!endarticle + ### ### Basic tests ### @@ -1328,8 +1361,7 @@ parsoid !! wikitext {{echo|–}} !! html -

-

+

!! end !! test @@ -1488,6 +1520,19 @@ Comment semantics: unclosed comment at end !! end +# Bug 58184: document parsoid's behaviour +!! test +Suppress comment closing tag in lenient browsers +!! options +parsoid=wt2html,html2html +!! wikitext + think this is closed --> +!! html/php + +!! html/parsoid + +!! end + !! test Comment in template title !! wikitext @@ -1649,6 +1694,11 @@ x
foo
z

z

!! end +# Tidy strips out the empty
tags. Parsoid doesn't. +# So, we have a separate section for Parsoid. We don't want +# to mimic this stripping behavior in Parsoid. It affects +# editing experience and also requires us to maintain additional +# info for RT-ing. !! test Empty lines between lines with block tags !! wikitext @@ -1687,6 +1737,19 @@ b

d


e
+!! html/parsoid +
+ +


+

a

+ +

b

+
a

b

+ +
b

d

+ +


+
e
!! end ## PHP parser emits output which is broken @@ -1709,6 +1772,22 @@ b

b

!! end +## SSS FIXME: I can come up with other scenarios where this doesn't work because +## of eager output of buffered tokens in the p-wrapper. But, I'm going to ignore +## them for now. +!! test +P-wrapping should leave sol-transparent tags outside p-tags where possible +!! options +parsoid=wt2html +!! wikitext +a [[Category:A1]] [[Category:A2]] +[[Category:A3]] +[[Category:A4]] +!! html/parsoid +

a

+ +!! end + ### ### Preformatted text ### @@ -1966,8 +2045,11 @@ Entities inside
 

!! end +# Parsoid doesn't strip empty tags, like Tidy does. !! test Empty pre; pre inside other HTML tags (bug 54946) +!! options +parsoid=wt2html,wt2wt !! wikitext a @@ -1975,7 +2057,7 @@ a foo

-!! html
+!! html/php
 

a

@@ -1983,12 +2065,18 @@ foo
 

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

a

 foo
 
+!! html/parsoid +

a

+ +
foo
+
+

 !! end
 
 !! test
@@ -2156,10 +2244,10 @@ parsoid=wt2html
 
!! html/parsoid -<pre -
x
+

<pre

x
+ +

<pre

-<pre
!! end @@ -2559,12 +2647,8 @@ c !! html/parsoid
a
- - - - - - +
b
+
b
!!end @@ -2613,6 +2697,12 @@ a c
foo
 foo 
 
+!! html/parsoid +

a

foo

+

b

foo
+

c

foo
+
 foo 
+
!! html+tidy

a

foo

@@ -2637,6 +2727,9 @@ a b
foo
+!! html/parsoid +
a foo
+ b
foo
!! html+tidy
 a foo
@@ -2878,8 +2971,7 @@ parsoid=wt2html,wt2wt
 {{echo| [[Category:foo]]}} 
 !! html
   
- 
- 
+  
 !! end
 
 !! test
@@ -2892,7 +2984,6 @@ parsoid=wt2html,wt2wt
 !! html
 
  a
-
  b
!! end @@ -4004,8 +4095,8 @@ External links: with no contents

!! html/parsoid

-

Bar

-

Bar

+

Bar

+

Bar

!! end !! test @@ -4751,7 +4842,7 @@ Parenthesis in external links, w/ transclusion or comment

(http://example.com)

!! html/parsoid -

(http://example.com/hi)

+

(http://example.com/hi)

(http://example.com)

!! end @@ -5129,8 +5220,8 @@ Accept "!!" in table data !! html/parsoid - - +
Foo!!
+
Foo!!
!! end @@ -5574,7 +5665,7 @@ Wikitext table with html-syntax row !! test Implicit after a |- !! options -parsoid=wt2html,wt2wt +parsoid=wt2html,html2html !! wikitext {| |- @@ -5598,7 +5689,7 @@ a !! test
 tags should be recognized in an explicit  context, but not in an implicit  context
 !! options
-parsoid=wt2html,wt2wt
+parsoid=wt2html,html2html
 !! wikitext
 {|
 |-
@@ -5638,10 +5729,11 @@ a
 !! end
 
 # PHP + Tidy strips the list out of the table; Parsoid wraps it.
+# Parsoid generates the missing , so wt2wt won't succeed.
 !! test
 Lists should be recognized in an implicit  context
 !! options
-parsoid=wt2html,wt2wt
+parsoid=wt2html,html2html
 !! wikitext
 {|
 |-
@@ -5679,14 +5771,19 @@ parsoid=wt2html,wt2wt
 {|
 |baz
 |}quux
-!! html
-
+!! html+tidy
+
-
foo
bar +foo + + +

bar

- -
baz
quux +baz + + +

quux

!! end !! test @@ -6483,7 +6580,7 @@ title=[[User:test/123]]

b

!! html/parsoid -

b

+

b

!! end !! test @@ -6503,7 +6600,7 @@ parsoid !! wikitext {{echo|Some [[Fool]]}}s !! html -

Some Fools

+

Some Fools

!! end !! test @@ -6513,7 +6610,7 @@ parsoid !! wikitext {{echo|Some [[Fool]]s are '''bold and foolish'''}} !! html -

Some Fools are bold and foolish

+

Some Fools are bold and foolish

!! end !! article @@ -6624,20 +6721,28 @@ Link with angle bracket after anchor !! test Inline interwiki link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[MeatBall:SoftSecurity]] -!! html +!! html/php

MeatBall:SoftSecurity

+!! html/parsoid +

MeatBall:SoftSecurity

!! end !! test Inline interwiki link with empty title (bug 2372) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[MeatBall:]] -!! html +!! html/php

MeatBall:

+!! html/parsoid +

MeatBall:

!! end !! test @@ -6666,6 +6771,10 @@ Interwiki link with fragment (bug 2130) !! end # Ideally the wikipedia: prefix here should be proto-relative too +# [CSA]: this is kind of a bogus test, as the PHP parser test doesn't +# define the 'en' prefix, and originally the test used 'wikipedia', +# which isn't a localinterwiki prefix hence the links to the 'en:Foo' +# article. !! test Different interwiki prefixes mapping to the same URL !! wikitext @@ -6683,19 +6792,19 @@ Different interwiki prefixes mapping to the same URL [[ wikiPEdia :Foo]] !! html/parsoid -

en:Foo

+

en:Foo

-

Foo

+

Foo

-

wikipedia:Foo

+

wikipedia:Foo

-

Foo

+

Foo

-

wikipedia:en:Foo

+

wikipedia:en:Foo

-

wikipedia:en:Foo

+

wikipedia:en:Foo

-

wikiPEdia :Foo

+

wikiPEdia :Foo

!! end !! test @@ -6707,60 +6816,97 @@ Interwiki links that cannot be represented in wiki syntax [http://de.wikipedia.org/wiki/Foo?action=history has query] [http://de.wikipedia.org/wiki/#foo is just fragment] +!! html/php +

meatball:ok +ok with fragment +ok ending with ? mark +has query +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 !! test Interwiki links: trail -!! options -parsoid !! wikitext [[wikipedia:Foo|Ba]]r -!! html -

Bar

+!! html/php +

Bar +

+!! html/parsoid +

Bar

!! end !! test Local interwiki link +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Template:Foo]] -!! html +!! html/php

local:Template:Foo

+!! html/parsoid +

local:Template:Foo

!! end +# Parsoid does not mark self-links, by design. !! test Local interwiki link: self-link to current page !! options title=[[Main Page]] +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:Main Page]] -!! html +!! html/php

local:Main Page

+!! html/parsoid +

local:Main Page

!! end !! test Local interwiki link: prefix only (bug 64167) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:]] -!! html +!! html/php

local:

+!! html/parsoid +

local:

!! end !! test Local interwiki link: with additional interwiki prefix (bug 61357) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext [[local:meatball:Hello]] -!! html +!! html/php

local:meatball:Hello

+!! html/parsoid +

local:meatball:Hello

+!! end + +!! test +Multiple local interwiki link prefixes +!! wikitext +[[local:local:local:local:mi:local:Foo]] +!! options +parsoid=wt2html,wt2wt,html2html +!! html/php +

local:local:local:local:mi:local:Foo +

+!! html/parsoid +

local:local:local:local:mi:local:Foo

!! end ### @@ -6777,12 +6923,14 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah -

+

Blah blah blah

+ !! end !! test Interlanguage link with spacing +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[ zh : Chinese ]] @@ -6790,8 +6938,8 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah -

+

Blah blah blah

+ !! end !! test @@ -6804,9 +6952,9 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah - -

+

Blah blah blah

+ + !! end !! test @@ -6819,9 +6967,9 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah - - +

Blah blah blah

+ + !! end !! test @@ -6835,8 +6983,8 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah -

+

Blah blah blah

+ !! end !! test @@ -6851,9 +6999,9 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah - -

+

Blah blah blah

+ + !! end !! test @@ -6865,8 +7013,8 @@ Blah blah blah

Blah blah blah

!! html/parsoid -

Blah blah blah -

+

Blah blah blah

+ !! end !! test @@ -6895,68 +7043,102 @@ He&nbsp;llo [[He&nbsp;llo]] !! test Parsoid: handle constructor well -!! options -parsoid !! wikitext [[constructor]] [[constructor:foo]] -!! html +!! html/php +

constructor +

constructor:foo +

+!! html/parsoid

constructor

constructor:foo

!! end +!! article +ko: +!! text +Test. +!! endarticle + +# Note that `ko` isn't a known interlanguage prefix !! test Parsoid: recognize interlanguage links without a target page !! options -parsoid +ill !! wikitext +[[es:]] + [[ko:]] -!! html -

+!! html/php +es: +!! html/parsoid + + +

ko:

!! end +# Note that `ko` isn't a known interwiki prefix !! test Parsoid: recognize interwiki links without a target page !! options -parsoid +parsoid=wt2html,wt2wt,html2html !! wikitext +[[:es:]] + [[:ko:]] -!! html -

ko:

+!! html/php +

es: +

ko: +

+!! html/parsoid +

es:

+

ko:

!! end !! test -Parsoid: Bug #45209, handle interwiki links pointing to the current wiki as plain wiki links -!! options -parsoid +Handle interwiki links pointing to the current wiki as plain wiki links (bug 45209) !! wikitext -[[en:Foo]] -!! html -

Foo

+[[mi:Foo]] +!! html/php +

mi:Foo +

+!! html/parsoid +

mi:Foo

!! end !! test Interlanguage link with preceding local interwiki link (bug 68085) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[local:es:Spanish]] -!! html +!! html/php

Blah blah blah local:es:Spanish

+!! html/parsoid +

Blah blah blah +local:es:Spanish

!! end !! test Looks like an interlanguage link, but is actually a local interwiki +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext Blah blah blah [[mi:Template:Foo]] -!! html +!! html/php

Blah blah blah mi:Template:Foo

+!! html/parsoid +

Blah blah blah +mi:Template:Foo

!! end ### @@ -6980,9 +7162,8 @@ parsoid=wt2html,wt2wt !! wikitext #REDIRECT [[Main_Page]] #REDIRECT [[[[Bar]]]] -!! html - - +!! html/parsoid + !! end !! test @@ -7248,11 +7429,12 @@ Horizontal ruler (should it add that extra space?)
foo
bar -!! html +!! html+tidy

-foo
bar - +

foo

+
+

bar

!! end !! test @@ -7718,6 +7900,8 @@ Unbalanced closing non-block tags don't break a list !! test Unclosed formatting tags that straddle lists are closed and reopened (php parser relies on Tidy to fix up) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext # a # b @@ -7727,12 +7911,8 @@ Unclosed formatting tags that straddle lists are closed and reopened
  • b
  • !! html/parsoid -
      -
    1. a -
    2. -
    3. b -
    4. -
    +
    1. a
    2. +
    3. b
    !! end # Parsoid fails this test, but it might be tricky to support properly. @@ -9237,19 +9417,15 @@ some

    here

    !! html/parsoid - -

    hu

    +

    hu

    +

    some

    +
    • stuff
    • +
    • here
    -

    some

    - -
      -
    • stuff
    • - -
    • here
    +

    here

    -

    here

    !! end # TODO: test with DOM fragment reuse! @@ -9270,25 +9446,17 @@ c}}d b}} !! html -ab -
    cd - - -

    ab

    - -
    - -

    cd

    +

    ab

    cd

    +

    ab

    +
    +

    cd

    -

    a

    +

    a

    - -
    +
    - -

    b

    +

    b

    !! end !! test @@ -9405,11 +9573,9 @@ parsoid=wt2html,wt2wt |foo |} !!html/parsoid - - - - -
    foo
    + + +
    foo
    !!end !!test @@ -9592,7 +9758,7 @@ Templates: Correctly encapsulate templates producing

    tag without a correspo b

    }} !! html/parsoid

    a -b

    +b

    !!end !!test @@ -10841,8 +11007,7 @@ parsoid=wt2html,wt2wt,html2html

    Foobar.jpg

    !! html/parsoid -

    -

    +

    !! end !! test @@ -10853,8 +11018,7 @@ Simple image (using File: namespace, now canonical)

    Foobar.jpg

    !! html/parsoid -

    -

    +

    !! end !! test @@ -10925,9 +11089,9 @@ thumbsize=220
    Caption Link1 [[]] Link2
    !! html/parsoid -
    Caption Link1 +
    Caption Link1 [[]] -Link2 +Link2
    !! end @@ -10961,7 +11125,7 @@ parsoid=wt2html,wt2wt,html2html
    This is a caption
    !! html/parsoid -
    This is a caption
    +
    This is a caption
    !! end !! test @@ -10972,7 +11136,7 @@ parsoid=wt2html,wt2wt,html2html
    This is a caption
    !! html/parsoid -
    This is a caption
    +
    This is a caption
    !! end !! test @@ -10983,7 +11147,7 @@ parsoid=wt2html,wt2wt,html2html

    Foobar.jpg

    !! html/parsoid -

    +

    !! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -10999,7 +11163,6 @@ Image with multiple attributes from the same template
    Caption text
    !! end -# Parsoid's output here is broken (incorrect p-wrapping); see bug 64901. !! test Image with link tails !! options @@ -11029,8 +11192,8 @@ thumbsize=220

    456

    !! html/parsoid

    123456

    -123
    456 -123
    456 +

    123

    456

    +

    123

    456

    !! end !! test @@ -11102,7 +11265,7 @@ parsoid=wt2html,wt2wt,html2html Foobar.jpg

    !! html/parsoid -

    +

    !! end !! test @@ -11383,7 +11546,9 @@ parsoid=wt2html,wt2wt,html2html
    caption
    !! html/parsoid -
    caption
    caption
    caption
    +
    caption
    +
    caption
    +
    caption
    !! end !! test @@ -11400,7 +11565,9 @@ parsoid=wt2html,wt2wt,html2html
    caption
    !! html/parsoid -
    caption
    caption
    caption
    +
    caption
    +
    caption
    +
    caption
    !! end ################### @@ -11527,7 +11694,10 @@ parsoid=wt2html,wt2wt,html2html
    Foobar.jpg
    !! html/parsoid -
    +
    +
    +
    +
    !! end ################### @@ -11886,7 +12056,9 @@ parsoid=wt2html,wt2wt,html2html
    caption
    !! html/parsoid -
    caption
    caption
    caption
    +
    caption
    +
    caption
    +
    caption
    !! end !! article @@ -11927,12 +12099,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -

    - - - - -

    +

    !! end !! test @@ -11943,12 +12110,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid -

    - - - - -

    +

    !! end !! test @@ -11968,12 +12130,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid -

    - - - - -

    +

    !! end !! test @@ -11997,12 +12154,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|left|baseline|thumb|caption content]] !! html/parsoid -
    - - - -
    caption content
    -
    +
    caption content
    !! end !! test @@ -12019,12 +12171,7 @@ Parsoid-specific image handling - thumbnail with specific size, halign, valign, !! wikitext [[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] !! html/parsoid -
    - - - -
    caption
    -
    +
    caption
    !! end !! test @@ -12044,12 +12191,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frame|500x50px|caption]] !! html/parsoid -
    - - - -
    caption
    -
    +
    caption
    !! end !! test @@ -12060,12 +12202,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] !! html/parsoid -
    - - - -
    caption
    -
    +
    caption
    !! end !! test @@ -12081,10 +12218,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|
    ab
    c
    ]] !! html/parsoid -

    - - -

    +

    !! end !! test @@ -12273,8 +12407,28 @@ Render invalid page names as plain text (bug 51090) [[foo<bar]]

    !!html/parsoid -

    [[./../foo|bar]][[foo�|bar]][[foo/.|bar]][[foo/..|bar]][[foo~~~bar]][[foo>bar]][[foo[bar]][[.]][[..]][[foo././bar]]

    -

    [[./../foo|bar]][[foo/.|bar]][[foo/..|bar]][[foo~~~~bar]][[foo>bar]][[foo././bar]][[foo{bar]][[foo}bar]][[foo[bar]][[foo]bar]][[foo<bar]]

    +

    [[./../foo|bar]] +[[foo�|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~bar]] +[[foo>bar]] +[[foo[bar]] +[[.]] +[[..]] +[[foo././bar]]

    + +

    [[./../foo|bar]] +[[foo/.|bar]] +[[foo/..|bar]] +[[foo~~~~bar]] +[[foo>bar]] +[[foo././bar]] +[[foo{bar]] +[[foo}bar]] +[[foo[bar]] +[[foo]bar]] +[[foo<bar]]

    !!end !! test @@ -12513,6 +12667,16 @@ parsoid !! end +!! test +Normalize hrefs properly before testing for invalid link targets (bug 70894) +!! options +parsoid=html2wt +!! html + +!! wikitext +[[Category:Toxine bactérienne]] +!! end + !! test Parsoid: Defaultsort !! options @@ -12537,9 +12701,9 @@ ill !! html/php es:Alimento fr:Nourriture zh:食品 !! html/parsoid -

    - -

    + + + !! end !! test @@ -12554,10 +12718,10 @@ ill !! html/php es:1 fr:1 !! html/parsoid -

    - - -

    + + + + !! end ### @@ -13237,16 +13401,15 @@ parsoid !! end -# The PHP parser escapes the opening brace to { for some reason, so -# disabled this test for it. !! test div with braces in attribute value -!! options -parsoid !! wikitext
    Foo
    -!! html -
    Foo
    +!! html/php +
    Foo
    + +!! html/parsoid +
    Foo
    !! end # This it very inconsistent in the PHP parser: it returns @@ -13254,17 +13417,19 @@ parsoid # 'div with empty attribute value, space before equals'), but strips the # attribute completely if the space is missing. We hope that not much content # depends on this, so are implementing the behavior below in Parsoid for -# consistencies' sake. Disabled for the PHP parser. +# consistencies' sake. # FIXME: fix this behavior in the PHP parser? !! test div with empty attribute value, no space before equals !! options -parsoid +parsoid=wt2html,html2html !! wikitext
    HTML rocks
    -!! html -
    HTML rocks
    +!! html/php +
    HTML rocks
    +!! html/parsoid +
    HTML rocks
    !! end !! test @@ -13685,7 +13850,7 @@ Bug 2304: HTML attribute safety (dangerous template; 2309)
    !! html/parsoid -
    +
    !! end !! test @@ -14005,9 +14170,12 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check) !! wikitext
    -
    -!! html +!! html/php
    -
    +!! html/parsoid +
    -
    !! end !! test @@ -14245,6 +14413,10 @@ Nested template calls ### ### Sanitizer ### + +# HTML+Tidy effectively strips out the empty tags completely +# But since Parsoid doesn't it wraps the tags in p-tags +# which Tidy would have done for the PHP parser had there been content inside it. !! test Sanitizer: Closing of open tags !! wikitext @@ -14252,6 +14424,8 @@ Sanitizer: Closing of open tags !! html
    +!! html/parsoid +

    !! end !! test @@ -14290,16 +14464,19 @@ Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=

    !! end +# In HTML5, the restrictions are that id must contain at least one character, +# and must not contain any space characters. !! test Sanitizer: Validating the contents of the id attribute (bug 4515) !! options disabled !! wikitext -
    +

    !! html -Something, but definitely not
    ... +Something ... !! end +# In HTML5, id must be unique amongst all the ids in the element's home subtree. !! test Sanitizer: Validating id attribute uniqueness (bug 4515, bug 6301) !! options @@ -14405,29 +14582,36 @@ HTML bullet list, closed tags (bug 5497)
  • One
  • Two
  • -!! html +!! html/php
    • One
    • Two
    +!! html/parsoid +
      +
    • One
    • +
    • Two
    • +
    + !! end !! test HTML bullet list, unclosed tags (bug 5497) -!! options -disabled !! wikitext
    • One
    • Two
    -!! html +!! html/php+tidy
      -
    • One -
    • -
    • Two -
    • +
    • One
    • +
    • Two
    • +
    +!! html/parsoid +
      +
    • One
    • +
    • Two
    !! end @@ -14439,29 +14623,37 @@ HTML ordered list, closed tags (bug 5497)
  • One
  • Two
  • -!! html +!! html/php
    1. One
    2. Two
    +!! html/parsoid +
      +
    1. One
    2. +
    3. Two
    4. +
    + !! end !! test HTML ordered list, unclosed tags (bug 5497) !! options -disabled !! wikitext
    1. One
    2. Two
    -!! html +!! html/php+tidy
      -
    1. One -
    2. -
    3. Two -
    4. +
    5. One
    6. +
    7. Two
    8. +
    +!! html/parsoid +
      +
    1. One
    2. +
    3. Two
    !! end @@ -14493,8 +14685,6 @@ HTML nested bullet list, closed tags (bug 5497) !! test HTML nested bullet list, open tags (bug 5497) -!! options -disabled !! wikitext
    • One @@ -14504,7 +14694,17 @@ disabled
    • Sub-two
    -!! html +!! html/php+tidy +
      +
    • One
    • +
    • Two: +
        +
      • Sub-one
      • +
      • Sub-two
      • +
      +
    • +
    +!! html/parsoid
    • One
    • @@ -14547,8 +14747,6 @@ HTML nested ordered list, closed tags (bug 5497) !! test HTML nested ordered list, open tags (bug 5497) -!! options -disabled !! wikitext
      1. One @@ -14558,7 +14756,17 @@ disabled
      2. Sub-two
      -!! html +!! html/php +
        +
      1. One +
      2. Two: +
          +
        1. Sub-one +
        2. Sub-two +
        +
      + +!! html/parsoid
      1. One
      2. @@ -14834,7 +15042,7 @@ Fuzz testing: image with bogus manual thumbnail
        Error creating thumbnail:
        !! html/parsoid - + !!end !! test @@ -14912,15 +15120,19 @@ New wiki paragraph

        !! end +# FIXME: The current php output is documented +# and desired output is the parsoid target. !! test Inline HTML vs wiki block nesting -!! options -disabled !! wikitext Bold paragraph New wiki paragraph -!! html +!! html/php +

        Bold paragraph +

        New wiki paragraph +

        +!! html/parsoid

        Bold paragraph

        New wiki paragraph

        @@ -15912,6 +16124,17 @@ Special:Search page linking.

        !! end +!! test +{{!}} is a magic word +!! wikitext +{{!}} is a magic word there and {{!}} is still a magic word here +!! html/php +

        | is a magic word there and | is still a magic word here +

        +!! html/parsoid +

        | is a magic word there and | is still a magic word here

        +!! end + !! test Say the magic word !! options @@ -16416,35 +16639,16 @@ Another italics / bold test
    !!end -# Note the results may be incorrect, as parserTest output included this: -# XML error: Mismatched tag at byte 6120: -# ...
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - +!! html/php +
    + +!! html/parsoid +
    !!end @@ -16587,7 +16791,7 @@ Definition list code coverage ; title : def ; title : def ;title: def -!! html +!! html/php
    title  
    def
    title 
    @@ -16595,6 +16799,10 @@ Definition list code coverage
    title
    def
    +!! html/parsoid +
    title  
    def
    +
    title 
    def
    +
    title
    def
    !! end !! test @@ -17277,45 +17485,51 @@ language=sr variant=sr-ec

    !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break image parsing if language converter markup is in the caption. !! options language=sr -disabled !! wikitext [[File:Foobar.jpg|-{R|caption}-]] -!! html +!! html/parsoid

    caption

    !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break list handling if language converter markup is in the item. !! options language=zh variant=zh-cn -disabled !! wikitext ;-{zh-cn:AAA;zh-tw:BBB}- -!! html +!! html/php +
    在手动语言转换规则中检测到错误
    + +!! html/parsoid
    AAA
    - !! end -# This test is currently broken in the PHP parser (bug 52661) +# FIXME: This test is currently broken in the PHP parser (bug 52661) !! test Don't break table handling if language converter markup is in the cell. !! options language=sr variant=sr-ec -disabled !! wikitext {| |- | -{R|B}- |} -!! html +!! html/php + + + +
    Б}- +
    + +!! html/parsoid @@ -17534,12 +17748,13 @@ Line two !! test Nesting tags, paragraphs on lines which begin with
    -!! options -disabled !! wikitext
    A B -!! html +!! html/php+tidy +

    A

    +

    B

    +!! html/parsoid

    A B @@ -17941,27 +18156,31 @@ comment ABC3D% ++ +%20 !! end +# FIXME: Omitting the php sections here because of differences in the local and +# jenkins output. But, more importantly, the Bad.jpg isn't being stripped, +# which seems to be a problem with the testing infrastructure. !! test Bad images - basic functionality -!! options -disabled !! wikitext [[File:Bad.jpg]] -!! html +!! html/parsoid + !! end +# FIXME: Same reasoning as above. The expected php is: +#

    Foo bar +#

    Bar foo +#

    !! test Bad images - bug 16039: text after bad image disappears -!! options -disabled !! wikitext Foo bar [[File:Bad.jpg]] Bar foo -!! html +!! html/parsoid

    Foo bar -

    Bar foo -

    + +Bar foo

    !! end !! test @@ -18138,18 +18357,22 @@ preload !! test Play a bit with r67090 and bug 3158 -!! options -disabled !! wikitext
     
     
     
     
    -!! html -
     
    -
     
    -
     
    -
     
    +!! html/php +
     
    +
     
    +
     
    +
     
    + +!! html/parsoid +
     
    +
     
    +
     
    +
     
    !! end @@ -18858,13 +19081,13 @@ parsoid=wt2html,wt2wt #### Parsoid-specific functionality tests #### ----------------------------------------------------------------- -# Bug 63642: Formatting elt fixup is cleaned up. +# Bug 63642/66749: Formatting elt fixup around images is cleaned up. # 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 -Bad treebuilder fixup of formatting elt is cleaned up +1. Bad treebuilder fixup of formatting elt is cleaned up !! options parsoid=wt2html,wt2wt !! wikitext @@ -18877,12 +19100,28 @@ parsoid=wt2html,wt2wt !! html/parsoid
    + +
    Test
    +
    +
    -

    -
    Test
    -

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

    foo

    +
    caption
    +

    bar

    +
    +!! end + #### ---------------------------------------------------------------- #### Parsoid-only testing of Parsoid's impl of and #### tags. Parsoid's output for these tags differs from that of the @@ -18898,9 +19137,9 @@ A foo B foo C !! html -

    A [1] -B [2] -C [3]

    +

    A [1] +B [2] +C [3]

    !!end !!test @@ -18911,8 +19150,8 @@ parsoid A foo B !! html -

    A [1] -B [1]

    +

    A [1] +B [1]

    !!end !!test @@ -18924,20 +19163,20 @@ A foo B C !! html -

    A [1] -B [1] -C [1]

    +

    A [1] +B [1] +C [1]

    !!end +# NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) !!test Ref: 4. 'constructor' should be accepted as a valid ref-name -(NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly) !!options parsoid !! wikitext A foo !! html -

    A [1]

    +

    A [1]

    !!end !!test @@ -18951,9 +19190,9 @@ A !! html -

    A [1]

    +

    A [1]

    -
      +
      1. ↑ This is a bolded link and this is a transclusion
      @@ -18972,9 +19211,9 @@ A !! html -

      A [1]

      +

      A [1]

      -
        +
        1. ↑ foo bar baz @@ -19002,9 +19241,9 @@ booz !! html -

          A [1]

          +

          A [1]

          -
            +
            1. ↑ foo bar @@ -19028,9 +19267,9 @@ A foo {{echo| B C}} !! html -

              A [1] B C}}

              -
                -
              1. ↑ foo {{echo|
              2. +

                A [1] B C}}

                +
                  +
                1. ↑ foo {{echo|
                !!end @@ -19042,9 +19281,9 @@ parsoid A foo "},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref">[1] B C

                -
                  -
                1. ↑ foo
                2. +

                  A [1] B C

                  +
                    +
                  1. ↑ foo
                  !!end @@ -19057,11 +19296,11 @@ A foo B C !! html -

                  A [1] B C

                  +

                  A [1] B C

                  -
                    -
                  1. ↑ foo
                  2. +
                      +
                    1. ↑ foo
                    !!end @@ -19073,8 +19312,8 @@ parsoid A foo B C bar D !! html -

                    A [1] B -C [2] D

                    +

                    A [1] B +C [2] D

                    !!end !!test @@ -19092,9 +19331,8 @@ c

                    a

                    -

                    b [1] -[2]

                    - +

                    b [1] +[2]

                    c

                    !!end @@ -19108,8 +19346,8 @@ parsoid bar B !! html -

                    [1] A -[2] B

                    +

                    [1] A +[2] B

                    !!end !!test @@ -19121,10 +19359,10 @@ parsoid !! html -

                    [1]

                    +

                    [1]

                    -
                      -
                    1. ↑ foo <ref>bar</ref> baz
                    2. +
                        +
                      1. ↑ foo <ref>bar</ref> baz
                      !!end @@ -19138,10 +19376,10 @@ B1 B2 bar !! html -

                      A1 [1] A2 [1] -B1 [2] B2 [2]

                      +

                      A1 [1] A2 [1] +B1 [2] B2 [2]

                      -
                      1. ↑ 1.0 1.1 foo
                      2. ↑ 2.0 2.1 bar
                      3. +
                        1. ↑ 1.0 1.1 foo
                        2. ↑ 2.0 2.1 bar
                        !!end @@ -19155,10 +19393,10 @@ A foo !! html -

                        A [1]

                        +

                        A [1]

                        -
                          -
                        1. ↑ foo
                        +
                          +
                        1. ↑ foo
                        !!end !!test @@ -19181,10 +19419,10 @@ B bar !! html -

                        A [a 1] -B [b 1]

                        +

                        A [a 1] +B [b 1]

                        -
                        1. ↑ foo
                        2. +
                          1. ↑ foo
                          !!end @@ -19201,14 +19439,14 @@ B bar !! html -

                          A [1]

                          +

                          A [1]

                          -
                          1. ↑ foo
                          2. +
                            1. ↑ foo
                            -

                            B [1]

                            +

                            B [1]

                            -
                            1. ↑ bar
                            2. +
                              1. ↑ bar
                              !!end @@ -19226,15 +19464,15 @@ C cfoo !! html -

                              A [a 1] -B [1]

                              +

                              A [a 1] +B [1]

                              -
                              1. ↑ afoo
                              2. +
                                1. ↑ afoo
                                -

                                C [2]

                                +

                                C [2]

                                -
                                1. ↑ bfoo
                                2. ↑ cfoo
                                3. +
                                  1. ↑ bfoo
                                  2. ↑ cfoo
                                  !!end @@ -19251,13 +19489,11 @@ B bar This should just get lost. !! html -

                                  A [1] -B [2]

                                  +

                                  A [1] +B [2]

                                  -
                                    -
                                  1. ↑ foo
                                  2. -
                                  3. ↑ bar
                                  4. +
                                    1. ↑ foo
                                    2. ↑ bar
                                    !!end @@ -19268,7 +19504,7 @@ parsoid !! wikitext Foo {{echo|}} !! html -[1]
                                    1. ↑ Foo
                                    +

                                    [1]

                                    1. ↑ Foo
                                    !!end !! test @@ -19285,12 +19521,12 @@ B foo
                                    !! html -

                                    A [1] -B [X 1]

                                    +

                                    A [1] +B [X 1]

                                    -
                                    1. ↑ foo bar for a
                                    +
                                    1. ↑ foo bar for a
                                    -
                                    1. ↑ foo
                                    +
                                    1. ↑ foo
                                    !! end !! test @@ -19300,7 +19536,7 @@ parsoid !! wikitext hi !! html -

                                    [1]

                                    +

                                    [1]

                                    !! end # This test is wt2html only because we're permitting the serializer to produce @@ -19314,11 +19550,11 @@ afoo !! html -

                                    a[1]

                                    +

                                    a[1]

                                    -
                                      -
                                    1. ↑ foo
                                    +
                                      +
                                    1. ↑ foo
                                    !! end !! test @@ -19332,6 +19568,69 @@ foo foo
                                      !! end +#--------- Test stripping of empty nodes in template content ---------- +!!test +Empty LI and TR nodes should be stripped from template content +!!wikitext +{{EmptyLITest}} +{{EmptyTRTest}} +!!html/parsoid +
                                        +
                                      • a
                                      • +
                                      • b
                                      • +
                                      + + + + + + + + + +
                                      foo
                                      bar
                                      +!!end + +!!test +Empty LI and TR nodes should not be stripped from top-level content +!!wikitext +* a +* +* b +{| +|- +|- +|foo +|} +!!html/parsoid +
                                        +
                                      • a
                                      • +
                                      • +
                                      • b
                                      • +
                                      + + + + + + + +
                                      foo
                                      +!!end + +!!test +Empty TR nodes should not be stripped if they have any attributes set +!!wikitext +{{EmptyTRWithHTMLAttrTest}} +!!html/parsoid + + + + + +
                                      foo
                                      bar
                                      +!!end + #### ---------------------------------------------------------------- #### The following section of tests are primarily to test #### wikitext escaping capabilities of Parsoid. Given that @@ -19376,9 +19675,9 @@ parsoid

                                      =fooa=

                                      !!end +# New headings and existing headings are handled differently !! test Headings: 1. Nested inside html -(New headings and existing headings are handled differently) !! options parsoid=html2wt !! wikitext @@ -19400,12 +19699,12 @@ parsoid=html2wt

                                      =foo=

                                      =foo=

                                      -

                                      =foo=

                                      -

                                      =foo=

                                      -

                                      =foo=

                                      -

                                      =foo=

                                      -
                                      =foo=
                                      -
                                      =foo=
                                      +

                                      =foo=

                                      +

                                      =foo=

                                      +

                                      =foo=

                                      +

                                      =foo=

                                      +
                                      =foo=
                                      +
                                      =foo=
                                      !!end !! test @@ -19767,9 +20066,9 @@ parsoid ----=foo= ----*foo !! html -
                                      ---- -
                                      =foo= -
                                      *foo +

                                      ----

                                      +

                                      =foo=

                                      +

                                      *foo

                                      !! end #### --------------- Tables --------------- @@ -20300,10 +20599,10 @@ parsoid=html2wt,wt2wt

                                      !! 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 -(FIXME: Escaping one or both of [[ and ]] is also acceptable -- - this is one of the shortcomings of this format) !! wikitext ''[[foo'']] @@ -20398,7 +20697,7 @@ parsoid foo ''a'' b !! html -

                                      foo [1]

                                      +

                                      foo [1]

                                      !! end !! test @@ -20650,7 +20949,7 @@ Table with broken attribute value quoting on consecutive lines | title="Hello world|Foo | style="color:red|Bar |} -!! html +!! html/php
                                      Foo @@ -20658,18 +20957,7 @@ Table with broken attribute value quoting on consecutive lines Bar
                                      -!! end - -!! test -Parsoid-only: Table with broken attribute value quoting on consecutive lines -!! options -parsoid -!! wikitext -{| -| title="Hello world|Foo -| style="color:red|Bar -|} -!! html +!! html/parsoid
                                      Foo @@ -20783,9 +21071,9 @@ RT-ed inter-element separators should be valid separators !!end +# Parsoid-only since PHP parser relies on Tidy for correct output !!test Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out -(Parsoid-only since PHP parser relies on Tidy for correct output) !!options parsoid !! wikitext @@ -20798,6 +21086,14 @@ bar |foo |} !! html + + +
                                      foo +

                                      bar

                                      + + + +
                                      foo
                                      !!end !!test @@ -20874,15 +21170,15 @@ Indent and comment before table row
                                      !! html/parsoid - - +
                                      +
                                      there
                                      !! end +# Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext !!test Empty TR followed by a template-generated TR -(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext) !!options parsoid !! wikitext @@ -20993,20 +21289,20 @@ plain text !!end !!test -1. Ensure fostered text content is wrapped in spans +1. Ensure fostered text content is wrapped in element nodes !!options parsoid=wt2html !! wikitext hi
                                      ho
                                      !! html -hi +

                                      hi

                                      -ho +

                                      ho

                                      !!end !!test -2. Ensure fostered text content is wrapped in spans (traps regressions around fostered marker on the span getting lost) +2. Ensure fostered text content is wrapped in element nodes (traps regressions around fostered marker on the element getting lost) !!options parsoid=wt2html,wt2wt !! wikitext @@ -21015,11 +21311,9 @@ parsoid=wt2html,wt2wt a !! html - || || - - - - +

                                      || || +

                                      a
                                      +
                                      a
                                      !!end @@ -21030,14 +21324,7 @@ parsoid=wt2html,wt2wt !! wikitext {{echo|foo
                                      bar
                                      }} !! html -foo - - - -
                                      bar
                                      +foo
                                      bar
                                      !!end !!test @@ -21047,14 +21334,13 @@ parsoid=wt2wt,wt2html !! wikitext {{echo|foo}}
                                      bar
                                      !! html -foo - +

                                      foo

                                      -
                                      bar
                                      +bar + + + !!end !!test @@ -21064,15 +21350,14 @@ parsoid=wt2wt,wt2html !! wikitext
                                      {{echo|foo}}
                                      bar
                                      !! html -
                                      foo
                                      +
                                      foo
                                      -
                                      bar
                                      +bar + + + !!end !!test @@ -21082,17 +21367,16 @@ parsoid=wt2wt,wt2html !! wikitext

                                      {{echo|foo

                                      }}bar
                                      !! html -
                                      -

                                      foo

                                      +
                                      +

                                      foo

                                      +
                                      -
                                      bar
                                      +bar + + + !!end !!test @@ -21102,17 +21386,16 @@ parsoid=wt2wt,wt2html !! wikitext

                                      {{echo|foo

                                      }}bar
                                      !! html -
                                      -

                                      foo

                                      +
                                      +

                                      foo

                                      +
                                      -
                                      bar
                                      +bar + + + !!end !!test @@ -21122,18 +21405,18 @@ parsoid=wt2wt,wt2html !! wikitext foo}}

                                      {{echo|foo

                                      !! html -foo +

                                      foo

                                      -

                                      foo

                                      +

                                      foo

                                      + + + + + !!end !!test @@ -21143,18 +21426,18 @@ parsoid=wt2wt,wt2html !! wikitext foo

                                      {{echo|foo

                                      }}

                                      ok

                                      !! html -foo +

                                      foo

                                      -

                                      foo

                                      +

                                      foo

                                      + + + + +

                                      ok

                                      !!end @@ -21165,14 +21448,14 @@ parsoid=wt2wt,wt2html !! wikitext {{echo|

                                      foo

                                      }}
                                      bar
                                      !! html -

                                      foo

                                      +

                                      foo

                                      -
                                      bar
                                      +bar + + + !!end !!test @@ -21186,11 +21469,13 @@ parsoid=wt2wt,wt2html |b |} !! html -

                                      a

                                      {{{1}}} - +

                                      a

                                      {{{1}}}

                                      -
                                      b
                                      +b + + + !!end !!test @@ -21200,8 +21485,7 @@ parsoid=wt2wt,wt2html !! wikitext {{echo|hi
                                      hello}} !! html -hi -
                                      hello +

                                      hi

                                      hello

                                      !!end !!test @@ -21216,7 +21500,7 @@ parsoid=wt2html,wt2wt |} !! html -
                                      +
                                      @@ -21256,15 +21540,15 @@ parsoid=html2wt # All these tests are marked Parsoid html2wt and html2html only # ---------------------------------------------------------------- +# 'mi' is a localinterwiki prefix as well as a language !! test Serialize interwiki links pointing to the current wiki as plain wiki links (bug 65869) !! options parsoid=html2wt -language=es !! wikitext [[Foo]] !! html -

                                      Foo

                                      +

                                      Foo

                                      !! end !! test @@ -21428,8 +21712,7 @@ parsoid !!end !! test -Image: New block level image should have \n before and after (existing -content) +Image: New block level image should have \n before and after (existing content) !! options parsoid !! wikitext @@ -21437,9 +21720,9 @@ parsoid [[File:Foobar.jpg|right|thumb|150x150px]] 456 !! html -

                                      123

                                      -
                                      -

                                      456

                                      +

                                      123

                                      +
                                      +

                                      456

                                      !!end !! test @@ -21451,7 +21734,9 @@ parsoid [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] !! html -
                                      caption
                                      caption
                                      caption
                                      +
                                      caption
                                      +
                                      caption
                                      +
                                      caption
                                      !!end !! test @@ -21770,9 +22055,9 @@ parsoid=html2wt ''A'''B''''' !! html -

                                      AB

                                      -

                                      AB

                                      -

                                      AB

                                      +

                                      AB

                                      +

                                      AB

                                      +

                                      AB

                                      !! end #------------------------------------ -- 2.20.1