From 88d7413ddff9bdcdfd65e3f2b05e0ec457ee891a Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Tue, 23 Feb 2016 11:46:20 -0800 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 239d2e60d82c736905a935525db748ebf6b45e23 Change-Id: Iec62b6824ab7d4c5d660999af130c777f8621571 --- tests/parser/parserTests.txt | 213 +++++++++++++++++++++++------------ 1 file changed, 141 insertions(+), 72 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 3bbc00dbb8..d01ebdffbd 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -2534,7 +2534,7 @@ parsoid=wt2html
!! html/parsoid -
x
+
x

<pre

@@ -2728,9 +2728,9 @@ Templates: Handle comments in parameter names (bug 67657) 1 = foo}} -{{echo|1 = foo}} +{{echo|1=foo}} -{{echo|1 = foo}} +{{echo|1=foo}} !!html/parsoid

foo

@@ -2872,7 +2872,7 @@ Templates: Preserve blank parameter names in other positions !! html/php+tidy

bar foo

!! html/parsoid -

bar +

bar foo

!! end @@ -4374,8 +4374,8 @@ Definition Lists: colons occurring in tags
a:b
a
b
-
a:b
-
a:b +
a:b
+
a:b
a:b
!! end @@ -5629,7 +5629,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 @@ -6085,7 +6085,7 @@ Accept "!!" in templates !! html/parsoid - + !! end !! test @@ -6370,6 +6370,19 @@ parsoid=wt2html
a bc
a bc
!! end +!! test +Break on | in element attribute in template +!! options +parsoid=wt2html,html2html +!! wikitext +{{echo|1=
ha
}} +!! html/php +

ho">ha</div> +

+!! html/parsoid +ho">ha +!! end + !! test Indented table markup mixed with indented pre content (proposed in bug 6200) !! wikitext @@ -7800,7 +7813,7 @@ parsoid !! wikitext {{echo|Some [[Fool]]}}s !! html -

Some Fools

+

Some Fools

!! end !! test @@ -7810,7 +7823,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 @@ -8399,7 +8412,7 @@ Blah blah blah !! wikitext #REDIRECT [[{{echo|Foo}}bar]] !! html/parsoid - + !! end !! test @@ -8836,7 +8849,7 @@ Mixed list !! html/parsoid
hi
-
  • ho
  • +
  • ho
  • !! end !! test @@ -10439,7 +10452,7 @@ Template with complex template as argument !! test Template with thumb image (with link in description) !! wikitext -{{paramtest|param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} +{{paramtest|param=[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} !! html/php This is a test template with parameter
    @@ -10522,7 +10535,7 @@ Don't abort table cell attribute parsing if wikilink is found in template arg |} !! html/parsoid - +
    Test One two "three" four
    Test One two "three" four
    !! end @@ -10737,7 +10750,7 @@ Templates with intersecting and overlapping ranges !! html/parsoid -

    ha

    +

    ha

    ho

    @@ -10967,7 +10980,9 @@ section=1 Un-closed !! wikitext -!! html +!! html/php +!! html/parsoid + !! end ## We used to, but no longer wt2wt this test since the default serializer @@ -11026,13 +11041,13 @@ c}}d b}} !! html -

    ab

    cd

    +

    ab

    cd

    -

    ab

    +

    ab

    cd

    -

    a

    +

    a

    @@ -11532,7 +11547,7 @@ Templates: Support for templates generating attributes and content
    foo
    !! html/parsoid -
    foo
    +
    foo
    !! end !! test @@ -12011,7 +12026,7 @@ Templates: Ugly templates: 5. Template encapsulation test: Non-trivial overlap o {{echo|
    foo}} {{echo|}} !! html/parsoid -
    foo +
    foo
    !! end @@ -12025,7 +12040,7 @@ Templates: Ugly templates: 6. Template encapsulation test: Cyclical nesting of t {{echo|
    }} {{echo|
    }} !! html/parsoid -
    +
    !! end @@ -12891,7 +12906,7 @@ parsoid=wt2html,wt2wt,html2html
    This is a caption
    !! html/parsoid -
    This is a caption
    +
    This is a caption
    !! end !! test @@ -12902,7 +12917,7 @@ parsoid=wt2html,wt2wt,html2html
    This is a caption
    !! html/parsoid -
    This is a caption
    +
    This is a caption
    !! end !! test @@ -12913,7 +12928,7 @@ parsoid=wt2html,wt2wt,html2html

    Foobar.jpg

    !! html/parsoid -

    +

    !! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -13295,7 +13310,7 @@ Alt image option should handle most kinds of wikitext without barfing
    This is a link and a bold template.
    This is the image caption
    !! html/parsoid -
    This is a link and a bold template.
    This is the image caption
    +
    This is a link and a bold template.
    This is the image caption
    !! end ################### @@ -14128,7 +14143,7 @@ T93580: 3. Templated inside inline images !! html/parsoid -

    +

    1. ↑ foo
    !! end @@ -14621,7 +14636,7 @@ parsoid=wt2html * {{echo|a [[Category:Foo]]}} !! html/parsoid -
    • a +
      • a
      !! end @@ -14636,7 +14651,7 @@ parsoid=wt2html !! html/parsoid
      • a
      - + !! end @@ -22030,8 +22045,11 @@ B !!end -!!test +## Don't expect this to rt since we're dropping content +!! test References: 5. ref tags in references should be processed while ignoring all other content +!! options +parsoid=wt2html,html2html !! wikitext A B bar @@ -22045,18 +22063,18 @@ This should just get lost. B [2]

      -
      1. ↑ foo
      2. ↑ bar
      3. +
        1. ↑ foo
        2. ↑ bar
        -!!end +!! end -!!test +!! test References: 6. from a transclusion !! wikitext Foo {{echo|}} !! html/parsoid

        [1]

        1. ↑ Foo
        -!!end +!! end !! test References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled @@ -22078,7 +22096,7 @@ B ↑ foo bar for a
      -
        +
        1. ↑ foo
        !! end @@ -22351,7 +22369,7 @@ parsoid=html2wt !! html/parsoid

        =boldfoo=

        !! wikitext -= ='''bold'''foo= = += ='''bold'''foo= = !!end !! test @@ -22555,35 +22573,52 @@ parsoid=html2wt ;Foo:bar !!end +## Making these next 3 tests Parsoid-only since they are html2wt tests +## to test wikitext escaping, and insignificant whitespace diffs +## cause PHP parser tests to barf !! test -Lists: 1. Nested inside html +Lists: 1. Nested inside html (No unnecessary escapes) !! options parsoid=html2wt !! html/parsoid -
        • *foo
        -
        • #foo
        -
        • :foo
        -
        • ;foo
        -
        1. *foo
        -
        1. #foo
        -
        1. :foo
        -
        1. ;foo
        +
          +
        • *foo
        • +
        • #foo
        • +
        • :foo
        • +
        • ;foo
        • +
        • *foo
        • +
        • #foo
        • +
        • :foo
        • +
        • ;foo
        • +
        +
          +
        1. *foo
        2. +
        3. #foo
        4. +
        5. :foo
        6. +
        7. ;foo
        8. +
        9. *foo
        10. +
        11. #foo
        12. +
        13. :foo
        14. +
        15. ;foo
        16. +
        !! wikitext +* *foo +* #foo +* :foo +* ;foo **foo - *#foo - *:foo - *;foo +# *foo +# #foo +# :foo +# ;foo #*foo - ##foo - #:foo - #;foo !!end @@ -22597,29 +22632,28 @@ parsoid=html2wt
        :foo
        bar
        :foo
        - !! wikitext -;;foo +; ;foo -;:foo +; :foo -;:foo -:bar +; :foo +: bar -::foo +: :foo !!end !! test -Lists: 3. Only bullets at start of text should be escaped +Lists: 3. Only bullets at start of text in wikitext-generated HTML should be escaped !! options parsoid=html2wt !! html/parsoid -
        • *foo*bar
        -
        • *fooit*bar
        - +
          +
        • *foo*bar
        • +
        • *fooit*bar
        • +
        !! wikitext -**foo*bar - +* *foo*bar **foo''it''*bar !!end @@ -23207,6 +23241,8 @@ parsoid=html2wt google]

        [http://google.com]

        [http://google.com google]

        +

        [http://google.com]

        +

        [http://google.com]

        !! wikitext [http://google.com [google]] [http://google.com google]] @@ -23215,11 +23251,16 @@ parsoid=html2wt [http://google.com google] +[http://google.com] + +[{{echo|http://google.com}}] !! html/php

        [google] google]

        [http://google.com]

        [http://google.com google] +

        [http://google.com] +

        [http://google.com]

        !! end @@ -23229,10 +23270,14 @@ Links 5. ExtLinks: No escapes needed parsoid=html2wt !! html/parsoid

        [google

        +

        []

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

        [google +

        [[1]]

        !! end @@ -24529,13 +24574,13 @@ parsoid=wt2wt,wt2html !! wikitext {{echo|hi
        hello}} !! html/parsoid -

        hi

        hello

        +

        hi

        hello

        !!end !!test Table in fosterable position !!options -parsoid=wt2html,wt2wt +parsoid=wt2html !! wikitext {{OpenTable}}
        @@ -24544,7 +24589,7 @@ parsoid=wt2html,wt2wt
        |} !! html/parsoid -
        +
        @@ -24562,7 +24607,7 @@ Properly encapsulate empty-content transclusions in fosterable positions }}
    !! html/parsoid - +
    !! end @@ -24580,6 +24625,30 @@ hello !! end +!! test +T115289: Unclosed table +!! wikitext +{{echo|}}[[Category:Two]] +!! html/parsoid +
    +!! end + +!! test +T115289: Don't migrate newlines out of tables with fostered content +!! wikitext +{{echo|[[Category:One]]}}[[Category:Two]] +!! html/parsoid +
    +!! end + +!! test +T73074: More fostering fun +!! wikitext +{{echo|}}[[Category:Two]] +!! html/parsoid +
    +!! end + !!test Support element with .data attribute !!options @@ -25148,11 +25217,11 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"}, -

    foo

    +

    foo

    !! wikitext -{{echo|1 = f=oo}} +{{echo|1=f=oo}} -{{echo|1 = f=oo|2 = bar}} +{{echo|1=f=oo|2=bar}} @@ -25166,7 +25235,7 @@ parsoid=html2wt !! html/parsoid

    http://stuff?is=ok

    !! wikitext -{{echo|1 = http://stuff?is=ok}} +{{echo|1=http://stuff?is=ok}} !! end !! test @@ -25864,7 +25933,7 @@ Use data-parsoid.firstWikitextNode to compute newline constraints for template c !! options parsoid=html2wt !! html/parsoid -a +a
    d
    -- 2.20.1