From c67a69411e5a2a73a246e801fae898cf46599441 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Thu, 22 Dec 2016 11:29:32 -0600 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 471eb1031510e06a82a18007222396934b34264f Change-Id: I676b656c9d45c73cfb4e8fdddd23d9c3c85845cd --- tests/parser/parserTests.txt | 284 +++++++++++++++++++++-------------- 1 file changed, 171 insertions(+), 113 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 07d50a8ce8..67abba0a34 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -292,8 +292,8 @@ CircularRef {{CircularRef}} !! html/parsoid -

[1]

-
  1. ↑ Error: Expansion loop detected at Template:CircularRef
+

[1]

+
  1. ↑ Error: Expansion loop detected at Template:CircularRef
!! end !! test @@ -1442,6 +1442,8 @@ Don't parse (T149622) !! html/php

<span class="error">

+!! html/parsoid +

<span class="error">

!! end !! test @@ -6463,6 +6465,18 @@ parsoid=wt2html,html2html ho">ha !! end +!! test +Don't break on | in extension attribute in template +!! wikitext +{{echo|ha}} + + +!! html/parsoid +

[1]

+ +
  1. ↑ ha
+!! end + ## We don't support roundtripping of these attributes in Parsoid. ## Selective serialization takes care of preventing dirty diffs. ## But, on edits, we dirty-diff the invalid attribute text. @@ -6633,9 +6647,9 @@ T107652: s in templates that also generate table cell attributes should be !! html/parsoid - +
Foo[1]
Foo[1]
-
  1. ↑ foo
+
  1. ↑ foo
!! end !! test @@ -12285,11 +12299,11 @@ Templates: Wiki Tables: 7. Fosterable s should get fostered !!html/parsoid -[1] +[1]
-
  1. ↑ foo
+
  1. ↑ foo
!!end !! test @@ -14582,9 +14596,9 @@ T93580: 1. Templated inside block images !! html/parsoid -
Caption with templated ref: [1]
+
Caption with templated ref: [1]
-
  1. ↑ foo
+
  1. ↑ foo
!! end !! test @@ -14594,9 +14608,9 @@ T93580: 2. inside inline images !! html/parsoid -

+

-
  1. ↑ foo
+
  1. ↑ foo
!! end !! test @@ -14606,9 +14620,9 @@ T93580: 3. Templated inside inline images !! html/parsoid -

+

-
  1. ↑ foo
+
  1. ↑ foo
!! end ### @@ -22400,13 +22414,13 @@ B foo C !! html/parsoid -

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

+

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

    -
  1. ↑ foo
  2. -
  3. ↑ foo
  4. -
  5. ↑
  6. +
  7. ↑ foo
  8. +
  9. ↑ foo
  10. +
  11. ↑
!!end @@ -22417,10 +22431,10 @@ A foo B !! html/parsoid -

A [1] -B [1]

+

A [1] +B [1]

    -
  1. 1 2 foo
  2. +
  3. 1 2 foo
!!end @@ -22432,11 +22446,11 @@ B C !! html/parsoid -

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

+

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

    -
  1. 1 2 3 foo
  2. +
  3. 1 2 3 foo
!!end @@ -22447,9 +22461,9 @@ Ref: 4. 'constructor' should be accepted as a valid ref-name A foo !! html/parsoid -

A [1]

+

A [1]

    -
  1. ↑ foo
  2. +
  3. ↑ foo
!!end @@ -22462,10 +22476,10 @@ A !! html/parsoid -

A [1]

+

A [1]

    -
  1. ↑ This is a bolded link and this is a transclusion +
  2. ↑ This is a bolded link and this is a transclusion
!!end @@ -22481,10 +22495,10 @@ A !! html/parsoid -

A [1]

+

A [1]

    -
  1. ↑ foo +
  2. ↑ foo bar baz
  3. @@ -22509,10 +22523,10 @@ booz !! html/parsoid -

    A [1]

    +

    A [1]

      -
    1. ↑ foo +
    2. ↑ foo bar @@ -22533,9 +22547,9 @@ A foo {{echo| B C}} !! html/parsoid -

      A [1] B C}}

      +

      A [1] B C}}

        -
      1. ↑ foo {{echo|
      2. +
      3. ↑ foo {{echo|
      !!end @@ -22545,9 +22559,9 @@ Ref: 9. unclosed comments should not leak out of ref-body A foo
    3. +
    4. ↑ foo
    !!end @@ -22558,11 +22572,11 @@ A foo B C !! html/parsoid -

    A [1] B C

    +

    A [1] B C

      -
    1. ↑ foo
    2. +
    3. ↑ foo
    !!end @@ -22573,11 +22587,11 @@ A foo B C bar D !! html/parsoid -

    A [1] B -C [2] D

    +

    A [1] B +C [2] D

      -
    1. ↑ foo
    2. -
    3. ↑ bar
    4. +
    5. ↑ foo
    6. +
    7. ↑ bar
    !!end @@ -22595,13 +22609,13 @@ c

    a

    -

    b [1] -[2]

    +

    b [1] +[2]

    c

      -
    1. ↑
    2. -
    3. ↑
    +
  4. ↑
  5. +
  6. ↑
!!end !!test @@ -22612,11 +22626,11 @@ Ref: 13. ref-tags are not SOL-transparent and block indent-pres
B !! html/parsoid -

[1] A -[2] B

+

[1] A +[2] B

    -
  1. ↑ foo
  2. -
  3. ↑ bar +
  4. ↑ foo
  5. +
  6. ↑ bar
!!end @@ -22631,9 +22645,9 @@ parsoid=wt2html !! html/parsoid -

[1] baz</ref>

+

[1] baz</ref>

-
  1. ↑ foo <ref>bar
+
  1. ↑ foo <ref>bar
!! end !!test @@ -22644,10 +22658,10 @@ B1 B2 bar !! html/parsoid -

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

+

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

-
  1. 1 2 foo
  2. 1 2 bar
  3. +
    1. 1 2 foo
    2. 1 2 bar
    !!end @@ -22661,24 +22675,24 @@ A foo !! html/parsoid -

    A [1]

    +

    A [1]

      -
    1. ↑ foo
    +
  4. ↑ foo
!!end !!test Ref: 17. Generate valid HTML5 id/about attributes !!wikitext foo +ve-created name !!html/parsoid -

[1] -

+

[1] +[2] + +

  1. ↑ foo
  2. ↑ ve-created name
-
    -
  1. ↑ foo
  2. -
!!end !!test @@ -22688,11 +22702,11 @@ Ref: 18. T58916: Extension attributes should be parsed as plain text !!html/parsoid -

[1] +

[1]

    -
  1. ↑ foo
  2. +
  3. ↑ foo
!!end @@ -22703,10 +22717,10 @@ Ref: 19. ref-tags with identical name encodings should get identical indexes !! html/parsoid -

1 [1] 2 [1] +

1 [1] 2 [1]

    -
  1. 1 2 foo
  2. +
  3. 1 2 foo
!!end @@ -22719,11 +22733,11 @@ C !! html/parsoid -

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

+

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

-
  1. 1 2 3 Foo one
  2. +
    1. 1 2 3 Foo one
    !!end @@ -22746,18 +22760,18 @@ C baz !! html/parsoid -

    A [a 1] -B [b 1] -C [1]

    +

    A [a 1] +B [b 1] +C [1]

      -
    1. ↑ foo
    2. +
    3. ↑ foo
      -
    1. ↑ baz
    2. +
    3. ↑ baz
      -
    1. ↑ bar
    2. +
    3. ↑ bar
    !!end @@ -22772,15 +22786,15 @@ B bar !! html/parsoid -

    A [1]

    +

    A [1]

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

      B [1]

      +

      B [1]

        -
      1. ↑ bar
      2. +
      3. ↑ bar
      !!end @@ -22796,15 +22810,15 @@ C cfoo !! html/parsoid -

      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 @@ -22822,11 +22836,11 @@ B bar This should just get lost. !! html/parsoid -

          A [1] -B [2]

          +

          A [1] +B [2]

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

            [1]

            1. ↑ Foo
            2. +

              [1]

              1. ↑ Foo
              !! end @@ -22851,16 +22865,16 @@ B foo !! html/parsoid -

              A [1] -B [X 1] +

              A [1] +B [X 1]

                -
              1. ↑ foo bar for a
              2. +
              3. ↑ foo bar for a
              -
                -
              1. ↑ foo
              2. +
                  +
                1. ↑ foo
                !! end @@ -22870,8 +22884,8 @@ References: 8. T88019: Remove s from templates inside that's itself X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}} !! html/parsoid -

                X[1]

                -
                1. ↑ foo bar and baz boo
                2. +

                  X[1]

                  +
                  1. ↑ foo bar and baz boo
                  !!end @@ -22885,12 +22899,12 @@ References: 9. Generate missing references list at the end A foo B bar !! html/parsoid -

                  A [1] B [inexistent 1]

                  +

                  A [1] B [inexistent 1]

                    -
                  1. ↑ foo
                  2. +
                  3. ↑ foo
                    -
                  1. ↑ bar
                  2. +
                  3. ↑ bar
                  !! end @@ -22916,9 +22930,9 @@ Entities in ref name hi !! html/parsoid -

                  [1]

                  +

                  [1]

                    -
                  1. ↑ hi
                  2. +
                  3. ↑ hi
                  !! end @@ -22936,10 +22950,10 @@ afoo !! html/parsoid -

                  a[1]

                  +

                  a[1]

                  <references>

                  -
                  1. ↑ foo
                  +
                  1. ↑ foo
                  !! end !! test @@ -22953,6 +22967,43 @@ foo foo
                    !! end +#### ---------------------------------------------------------------- +#### Parsoid-only testing of Parsoid's impl of LST +#### Not implemented yet, see +#### https://www.mediawiki.org/wiki/Parsoid/HTML_based_LST +#### ---------------------------------------------------------------- + +## We still need to support serializing the older format while content is stored. +!! test +LST Sections: Backwards compatibility +!! options +parsoid={ + "suppressErrors": true, + "modes": ["html2wt"] +} +!! wikitext +
                    +
                    +!! html/parsoid +

                    +

                    +!! end + +## The unconventional output is the result of `usePHPPreProcessor` being +## disabled in parserTests.js. This test is mainly just to show
                    is +## recognized as an extension tag w/o a native handler. +!! test +LST Sections: Newfangled approach +!! options +parsoid={ "suppressErrors": true } +!! wikitext +
                    +
                    +!! html/parsoid +

                    <section begin="2011-05-16" /> +<section end="2014-04-10 (MW 1.23wmf22)" />

                    +!! end + #--------- Test stripping of empty nodes in template content ---------- !!test Empty LI and TR nodes should be stripped from template content @@ -24291,11 +24342,11 @@ parsoid=html2wt a' foo bar a' foo bar foo x'bar -'foo [1] +'foo [1] 'foo
                    test
                    'foo and
                    bar
                      -
                    1. ↑ test
                    2. +
                    3. ↑ test
                    !! wikitext '''a'' foo ''[[bar]]'' @@ -24443,9 +24494,9 @@ a !! options parsoid=html2wt !! html/parsoid -

                    foo [1]

                    +

                    foo [1]

                      -
                    1. ↑ a +
                    2. ↑ a b
                    !! wikitext @@ -25951,9 +26002,9 @@ parsoid={ "scrubWikitext": true } !! html/parsoid -

                    foo [1]

                    +

                    foo [1]

                    -
                    1. ↑ bar
                    +
                    1. ↑ bar
                    !! wikitext == foo bar [[Category:Baz]] == @@ -26041,9 +26092,9 @@ parsoid=html2wt

                    hi there you

                    -

                    foo [1]

                    +

                    foo [1]

                    -
                    1. ↑ hello +
                      1. ↑ hello there
                      • asd @@ -26655,7 +26706,8 @@ parsoid={ [ "#h2", "html", "a\nb\n" ], [ "#c1", "html", "a\nb\n" ], [ "#c2", "html", "

                        a

                        " ], - [ "#c3", "html", "

                        a

                        " ] + [ "#c3", "html", "

                        a

                        " ], + [ "#c4", "html", "edit-me

                        a

                        " ] ] } !! wikitext @@ -26669,6 +26721,8 @@ parsoid={ | id="c2" |edit-me||4 |- | id="c3" |edit-me||p||q||r +|- +| id="c4" |edit-me||p||q||r |} !! wikitext/edited {| @@ -26689,6 +26743,10 @@ b |- | id="c3" |a |p||q||r +|- +| id="c4" |edit-me +a +|p||q||r |} !! end -- 2.20.1