From 7b56518d5153c458388bc015193754174448b327 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Wed, 28 Jan 2015 15:49:10 -0800 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 88605a4a7a37a61da76238db6d3fff756e8514f1 Change-Id: Ia6d103bec95019eaece64166172a166f8eabdd09 --- tests/parser/parserTests.txt | 1028 ++++++++++++++++++++++------------ 1 file changed, 674 insertions(+), 354 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 7eb152ab8e..18aeabb540 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -111,12 +111,6 @@ Template:echo_with_div
{{{1}}}
!! endarticle -!! article -Template:attr_str -!! text -{{{1}}}="{{{2}}}" -!! endarticle - !! article Template:table_attribs !! text @@ -137,6 +131,15 @@ Template:image_attribs [[File:foobar.jpg|right|Caption text]] !! endarticle +## See T48811 for details +!! article +Template:mixed_attr_content_template +!! text +style="color:red;" title="T48811" +|- +|foo +!! endarticle + !! article A?b !! text @@ -706,7 +709,7 @@ parsoid=wt2html !! test Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki !! wikitext -''''foo'''' +''''foo'''' !! html

'foo'

@@ -1322,10 +1325,10 @@ parsoid Properly escape nowiki when combined with other wiki markup !! options parsoid=html2wt -!! wikitext -* </nowiki> tag !! html

* </nowiki> tag

+!! wikitext +* </nowiki> tag !! end ### @@ -2519,6 +2522,18 @@ parsoid

a : b

!! end +## Bug T73412 +!! test +Templates: Preserve blank parameter names +!! wikitext +{{echo|=foo}} +!! html/php +

{{{1}}} +

+!! html/parsoid +

{{{1}}}

+!! end + ### ### Parsoid-centric tests for testing RT edge cases for pre ### @@ -3201,10 +3216,12 @@ Definition list with wikilink containing colon Definition list with news link containing colon !! wikitext ; news:alt.wikipedia.rox: This isn't even a real newsgroup! -!! html +!! html/php
news:alt.wikipedia.rox
This isn't even a real newsgroup!
+!! html/parsoid +
news:alt.wikipedia.rox
This isn't even a real newsgroup!
!! end !! test @@ -4188,7 +4205,7 @@ http://example.com/url_with_entity  http://example.com/url_with_entity< http://example.com/url_with_entity< http://example.com/url_with_entity< -!! html +!! html/php

http://example.com, http://example.com; http://example.com\ @@ -4206,6 +4223,23 @@ http://example.com/url_with_entity< http://example.com/url_with_entity%3C http://example.com/url_with_entity%3C

+!! html/parsoid +

http://example.com, +http://example.com; +http://example.com\ +http://example.com. +http://example.com: +http://example.com! +http://example.com? +http://example.com) +http://example.com/url_with_(brackets) +(http://example.com/url_without_brackets) +http://example.com/url_with_entity  +http://example.com/url_with_entity  +http://example.com/url_with_entity  +http://example.com/url_with_entity< +http://example.com/url_with_entity< +http://example.com/url_with_entity<

!! end !! test @@ -4310,10 +4344,12 @@ URL in text: [http://example.com http://example.com] External links: Clickable images !! wikitext ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] -!! html +!! html/php

ja-style clickable images: Ncwikicol.png

-!!end +!! html/parsoid +

ja-style clickable images: Ncwikicol.png

+!! end !! test External links: raw ampersand @@ -4503,10 +4539,12 @@ http://www.example.com/ BUG 289: literal ">"-token in URL-tail !! wikitext http://www.example.com/html -!! html +!! html/php

http://www.example.com/html

-!!end +!! html/parsoid +

http://www.example.com/html

+!! end !! test BUG 289: ">"-token in bracketed URL @@ -5971,6 +6009,11 @@ parsoid=wt2html,wt2wt Parsoid: Default to a newline after tables in new content (bug 51219) !! options parsoid=html2wt +!! html + +
foo
bar + +
baz
quux !! wikitext {| |foo @@ -5980,23 +6023,18 @@ parsoid=html2wt |baz |} '''quux''' -!! html - -
foo
bar - -
baz
quux !! end !! test Parsoid: newline inducing block nodes don't suppress !! options parsoid=html2wt +!! html + a

foo

!! wikitext a = foo = -!! html - a

foo

!! end !! test @@ -6231,9 +6269,11 @@ Bug 43661: Piped links with identical prefixes Link with HTML entity in suffix / tail !! wikitext [[Main Page]]", [[Main Page]]a -!! html +!! html/php

Main Page", Main Pagea

+!! html/parsoid +

Main Page", Main Pagea

!! end !! test @@ -6268,10 +6308,13 @@ Piped link with extlink-like text !! wikitext [[Main Page|[bar]]] [[Main Page|This is a [bar]]] -!! html +!! html/php

[bar] This is a [bar]

+!! html/parsoid +

[bar] +This is a [bar]

!! end !! test @@ -6336,11 +6379,10 @@ Namespace takes precedence over interwiki link (bug 51680) Link to namespace preferred over interwiki with correct rel attribute !! options parsoid=html2wt,html2html +!! html +

MemoryAlpha:AlphaTest

!! wikitext [[MemoryAlpha:AlphaTest]] -!! html -

MemoryAlpha:AlphaTest -

!! end !! test @@ -6845,10 +6887,10 @@ mótmælenda[[söfnuður|söfnuðir]]xxx Parsoid link trail escaping !! options parsoid=html2wt,html2html -!! wikitext -[[apple]]s !! html

apples

+!! wikitext +[[apple]]s !! end !! test @@ -6856,10 +6898,10 @@ Parsoid link prefix escaping !! options language=is parsoid=html2wt,html2html -!! wikitext -Aðrir mótmælenda[[söfnuður]] !! html

Aðrir mótmælendasöfnuður

+!! wikitext +Aðrir mótmælenda[[söfnuður]] !! end !! test @@ -7228,13 +7270,13 @@ language=ln Parsoid bug 53221: Wikilinks should be properly entity-escaped !! options parsoid=html2wt +!! html +

He&nbsp;llo He&nbsp;llo

+

He&nbsp;llo He&nbsp;llo

!! wikitext He&nbsp;llo [[Foo|He&nbsp;llo]] He&nbsp;llo [[He&nbsp;llo]] -!! html -

He&nbsp;llo He&nbsp;llo

-

He&nbsp;llo He&nbsp;llo

!! end !! test @@ -7498,11 +7540,11 @@ language=is New redirect !! options parsoid=html2wt +!! html +

Foo

!! wikitext Foo #REDIRECT [[Foo]] -!! html -

Foo

!! end ## @@ -8875,10 +8917,10 @@ hi+world%3F%21 Magic Word: prioritize type info over data-parsoid !! options parsoid=html2wt -!! wikitext -__FORCETOC__ !! html +!! wikitext +__FORCETOC__ !! end !! test @@ -8960,9 +9002,11 @@ ISBN 0-306-40615-2 Magic links: ISBN (bug 65278) !! wikitext This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked. -!! html +!! html/php

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

+!! html/parsoid +

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

!! end !! test @@ -9309,15 +9353,6 @@ Template parameter as link source

!! end -!!test -Template-generated attribute string (k='v') -!! wikitext -bar -!! html -

bar -

-!!end - !!article Template:paramtest2 !! text @@ -10160,6 +10195,9 @@ Templates: HTML Tag: 6. Generation of end piece of HTML attr value !!end +# SSS FIXME: While it is great we added support for all this, +# do we want to make this part of the spec? Maybe we want to +# deprecate this kind of usage in the future? !!test Templates: HTML Tag: 7. Generation of partial attribute key string !! wikitext @@ -10169,6 +10207,50 @@ Templates: HTML Tag: 7. Generation of partial attribute key string !!end +!! test +Templates: HTML Tag: 8. Template-generated attribute (k=v) +!! wikitext +
bar
+!! html +
bar
+ +!!end + +!! test +Templates: HTML Tag: 9. Multiple template-generated attributes +!! wikitext +
bar
+!! html +
bar
+ +!!end + +!! test +Templates: Support for templates generating attributes and content +!! wikitext +{| {{mixed_attr_content_template}} +|- +|bar +|} +!! html/php + + + + + +
foo +
bar +
+ +!! html/parsoid + + + + + +
foo
bar
+!!end + !!test Templates: HTML Tables: 1. Generating start of a HTML table !! wikitext @@ -11142,26 +11224,26 @@ parsoid=wt2html Parsoid: Escape nowiki with trailing space in tags !! options parsoid=html2wt +!! html +

<nowiki > foo </nowiki >

+

a<nowiki />b

+

c<nowiki/ >d

!! wikitext <nowiki > foo </nowiki > a<nowiki />b c<nowiki/ >d -!! html -

<nowiki > foo </nowiki >

-

a<nowiki />b

-

c<nowiki/ >d

!! end !! test Parsoid: Escape weird noWikI capitalizations !! options parsoid=html2wt -!! wikitext -<noWikI > foo </NoWikI > !! html

<noWikI > foo </NoWikI >

+!! wikitext +<noWikI > foo </NoWikI > !! end ### @@ -11389,6 +11471,17 @@ Link with empty target

!! end +!! test +Image with link trail +!! wikitext +Linktrails should not work for images: [[File:Foobar.jpg]]s +!! html/php +

Linktrails should not work for images: Foobar.jpgs +

+!! html/parsoid +

Linktrails should not work for images: s

+!! end + !! test Image with empty attribute !! options @@ -13351,10 +13444,12 @@ __TOC__ !! test BUG 1219 URL next to image (good) !! wikitext -http://example.com [[Image:foobar.jpg]] -!! html +http://example.com [[File:Foobar.jpg]] +!! html/php

http://example.com Foobar.jpg

+!! html/parsoid +

http://example.com

!!end !! test @@ -13577,10 +13672,12 @@ c3--> !! test BUG 1219 URL next to image (broken) !! wikitext -http://example.com[[Image:foobar.jpg]] -!! html +http://example.com[[File:Foobar.jpg]] +!! html/php

http://example.comFoobar.jpg

+!! html/parsoid +

http://example.com

!!end !! test @@ -15308,32 +15405,38 @@ Fuzz testing: Parser25 (bug 6055) Fuzz testing: URL adjacent extension (with space, clean) !! wikitext http://example.com junk -!! html +!! html/php

http://example.com junk

-!!end +!! html/parsoid +

http://example.com junk

+!! end !!test Fuzz testing: URL adjacent extension (no space, dirty; nowiki) !! wikitext http://example.comjunk -!! html +!! html/php

http://example.comjunk

-!!end +!! html/parsoid +

http://example.comjunk

+!! end !!test Fuzz testing: URL adjacent extension (no space, dirty; pre) !! wikitext http://example.com
junk
-!! html +!! html/php http://example.com
junk
-!! html+tidy +!! html/php+tidy

http://example.com

 junk
 
+!! html/parsoid +

http://example.com

junk
!!end !!test @@ -16792,6 +16895,8 @@ ISBN 978-0-1234-56 789

!! html+tidy

ISBN 978-0-1234-56 789

+!! html/parsoid +

ISBN 978-0-1234-56 789

!! end !! test @@ -16807,24 +16912,37 @@ ISBN Double ISBN !! wikitext ISBN ISBN 1234567890 -!! html +!! html/php

ISBN ISBN 1234567890

+!! html/parsoid +

ISBN ISBN 1234567890

!! end !! test ISBN with an X !! wikitext ISBN 3-462-04561-X -!! html +ISBN 080442957X +ISBN 978080442957X +!! html/php

ISBN 3-462-04561-X +ISBN 080442957X +ISBN 978080442957X

+!! html/parsoid +

ISBN 3-462-04561-X +ISBN 080442957X +ISBN 978080442957X

!! end !! test ISBN with empty prefix (parsoid test) !! wikitext ISBN 1234567890 +!! html/php +

ISBN 1234567890 +

!! html/parsoid

ISBN 1234567890

!! end @@ -16833,9 +16951,11 @@ ISBN 1234567890 Bug 22905: followed by ISBN followed by !! wikitext (fr) ISBN 2753300917 [http://www.example.com example.com] -!! html +!! html/php

(fr) ISBN 2753300917 example.com

+!! html/parsoid +

(fr) ISBN 2753300917 example.com

!! end !! test @@ -19465,9 +19585,9 @@ A foo B foo C !! html -

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

+

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

!!end !!test @@ -19478,8 +19598,8 @@ parsoid A foo B !! html -

A [1] -B [1]

+

A [1] +B [1]

!!end !!test @@ -19491,9 +19611,9 @@ 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) @@ -19504,7 +19624,7 @@ parsoid !! wikitext A foo !! html -

A [1]

+

A [1]

!!end !!test @@ -19518,10 +19638,10 @@ A !! html -

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 @@ -19539,10 +19659,10 @@ A !! html -

A [1]

+

A [1]

    -
  1. ↑ foo +
  2. ↑ foo bar baz
  3. @@ -19569,10 +19689,10 @@ booz !! html -

    A [1]

    +

    A [1]

      -
    1. ↑ foo +
    2. ↑ foo bar @@ -19595,9 +19715,9 @@ A foo {{echo| B C}} !! html -

      A [1] B C}}

      +

      A [1] B C}}

        -
      1. ↑ foo {{echo|
      2. +
      3. ↑ foo {{echo|
      !!end @@ -19609,9 +19729,9 @@ parsoid A foo "},"attrs":{}}'>[1] B C

      +

      A [1] B C

        -
      1. ↑ foo
      2. +
      3. ↑ foo
      !!end @@ -19624,11 +19744,11 @@ A foo B C !! html -

      A [1] B C

      +

      A [1] B C

        -
      1. ↑ foo
      2. +
      3. ↑ foo
      !!end @@ -19640,8 +19760,8 @@ parsoid A foo B C bar D !! html -

      A [1] B -C [2] D

      +

      A [1] B +C [2] D

      !!end !!test @@ -19659,8 +19779,8 @@ c

      a

      -

      b [1] -[2]

      +

      b [1] +[2]

      c

      !!end @@ -19674,8 +19794,8 @@ parsoid bar B !! html -

      [1] A -[2] B

      +

      [1] A +[2] B

      !!end !!test @@ -19687,10 +19807,10 @@ parsoid !! html -

      [1]

      +

      [1]

        -
      1. ↑ foo <ref>bar</ref> baz
      2. +
      3. ↑ foo <ref>bar</ref> baz
      !!end @@ -19704,10 +19824,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 @@ -19721,10 +19841,10 @@ A foo !! html -

        A [1]

        +

        A [1]

          -
        1. ↑ foo
        +
      4. ↑ foo
      !!end !!test @@ -19736,11 +19856,42 @@ parsoid !!html -

      [1] +

      [1] +

      + +
        +
      1. ↑ foo
      2. +!!end + +!!test +Ref: 18. T58916: Extension attributes should be parsed as plain text +!!options +parsoid +!!wikitext +foo + + +!!html +

        [1]

          -
        1. ↑ foo
        2. +
        3. ↑ foo
        4. +!!end + +!!test +Ref: 19. ref-tags with identical name encodings should get identical indexes +!!options +parsoid +!! wikitext +1 foo 2 + + +!! html +

          1 [1] 2 [1] + +

          1. ↑ 1.0 1.1 foo
          2. +
          !!end !!test @@ -19763,10 +19914,10 @@ B bar !! html -

          A [a 1] -B [b 1]

          +

          A [a 1] +B [b 1]

          -
          1. ↑ foo
          2. +
            1. ↑ foo
            !!end @@ -19783,14 +19934,14 @@ B bar !! html -

            A [1]

            +

            A [1]

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

              B [1]

              +

              B [1]

              -
              1. ↑ bar
              2. +
                1. ↑ bar
                !!end @@ -19808,15 +19959,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 @@ -19833,11 +19984,11 @@ B bar This should just get lost. !! html -

                    A [1] -B [2]

                    +

                    A [1] +B [2]

                    -
                    1. ↑ foo
                    2. ↑ bar
                    3. +
                      1. ↑ foo
                      2. ↑ bar
                      !!end @@ -19848,7 +19999,7 @@ parsoid !! wikitext Foo {{echo|}} !! html -

                      [1]

                      1. ↑ Foo
                      +

                      [1]

                      1. ↑ Foo
                      !!end !! test @@ -19865,12 +20016,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 @@ -19880,7 +20031,7 @@ parsoid !! wikitext hi !! html -

                      [1]

                      +

                      [1]

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

                      a[1]

                      +

                      a[1]

                        -
                      1. ↑ foo
                      +
                    4. ↑ foo
                    !! end !! test @@ -20024,6 +20175,17 @@ parsoid Headings: 1. Nested inside html !! options parsoid=html2wt +!! html +

                    =foo=

                    +

                    =foo=

                    +

                    =foo=

                    + +

                    =foo=

                    +

                    =foo=

                    +

                    =foo=

                    +

                    =foo=

                    +
                    =foo=
                    +
                    =foo=
                    !! wikitext = =foo= = @@ -20038,23 +20200,16 @@ parsoid=html2wt ======foo====== =======foo======= -!! html -

                    =foo=

                    -

                    =foo=

                    -

                    =foo=

                    - -

                    =foo=

                    -

                    =foo=

                    -

                    =foo=

                    -

                    =foo=

                    -
                    =foo=
                    -
                    =foo=
                    !!end !! test Headings: 2. Outside heading nest on a single line

                    foo

                    *bar !! options parsoid=html2wt +!! html +

                    foo

                    *bar +

                    foo

                    =bar +

                    foo

                    =bar= !! wikitext = foo = *bar @@ -20064,10 +20219,6 @@ parsoid=html2wt = foo = =bar= -!! html -

                    foo

                    *bar -

                    foo

                    =bar -

                    foo

                    =bar= !!end !! test @@ -20096,6 +20247,8 @@ Headings: 4a. No escaping needed (testing just h1 and h2) == foo= == = = = + += ''=''foo= = !! html/parsoid

                    =foo

                    foo=

                    @@ -20104,32 +20257,22 @@ Headings: 4a. No escaping needed (testing just h1 and h2)

                    =foo

                    foo=

                    =

                    -!!end - -!! test -Headings: 4a'. No escaping needed (Parsoid bug T84903) -!! wikitext -= ''=''foo= = -!! html/php -

                    =foo=[edit]

                    - -!! html/parsoid

                    =foo=

                    -!! end +!!end !! test Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt -!! wikitext -=== -=foo= x -=foo= !! html

                    === =foo= x =foo=

                    +!! wikitext +=== +=foo= x +=foo= !!end !! test @@ -20233,13 +20376,31 @@ parsoid Headings: 6d. Heading chars in SOL context (No escaping needed) !! options parsoid=html2wt -!! wikitext -=a=
                    b
                    !! html =a=
                    b
                    +!! wikitext +=a=
                    b
                    !!end -#### --------------- Lists --------------- +!! test +Headings: 7. Insert a newline between new content and headings +!! options +parsoid=html2wt +!! html +

                    NEW

                    +

                    new

                    +

                    A

                    +

                    a

                    +!! wikitext +== NEW == +new + +==A== +a + +!! end + +#### --------------- Lists --------------- #### 0. Outside nests (*foo, etc.) #### 1. Nested inside html
                    • *foo
                    #### 2. Inside definition lists @@ -20389,10 +20550,10 @@ Lists: 5. No unnecessary escapes Lists: 6. Escape bullets in SOL position !! options parsoid=html2wt -!! wikitext -*foo !! html

                    *foo

                    +!! wikitext +*foo !!end !! test @@ -20410,10 +20571,10 @@ a Lists: 8. Escape colons only if not present in tags !! options parsoid=html2wt -!! wikitext -; a:b''c:d'' !! html
                    a:bc:d
                    +!! wikitext +; a:b''c:d'' !! end #### --------------- HRs --------------- @@ -20640,14 +20801,6 @@ parsoid=html2wt Tables: 4a. Escape - !! options parsoid=html2wt -!! wikitext -{| - -!-bar - -|- -|-bar -|} !! html/* @@ -20658,20 +20811,20 @@ parsoid=html2wt
                    -bar
                    -!! end - -!! test -Tables: 4b. Escape + -!! options -parsoid=html2wt !! wikitext {| -!+bar +!-bar |- -|+bar +|-bar |} +!! end + +!! test +Tables: 4b. Escape + +!! options +parsoid=html2wt !! html/* @@ -20682,6 +20835,14 @@ parsoid=html2wt
                    +bar
                    +!! wikitext +{| + +!+bar + +|- +|+bar +|} !! end !! test @@ -20790,23 +20951,39 @@ parsoid=wt2html #### 5. Extlinks: No escapes needed #### -------------------------------------- !! test -Links 1. Quote marks in link text -!! options -parsoid +Links 1. WikiLinks: No escapes needed !! wikitext -[[Foo|Foo''boo'']] -!! html -Foo''boo'' +[[Foo|Foo''boo'']] +[[Foo|[Foobar]]] +[[Foo|x [Foobar] x]] +!! html/php +

                    Fooboo +[Foobar] +x [Foobar] x +

                    +!! html/parsoid +

                    Fooboo +[Foobar] +x [Foobar] x

                    !! end !! test Links 2. WikiLinks: Escapes needed !! options -parsoid +parsoid=html2wt +!! html/parsoid +Foobar] +x [http://google.com g] x +[[Bar]] +x [[Bar]] x +|Bar +]]bar +[[bar +x [[ y +x ]] y +x ]] y [[ z !! wikitext -[[Foo|[Foobar]]] [[Foo|Foobar]]] -[[Foo|x [Foobar] x]] [[Foo|x [http://google.com g] x]] [[Foo|[[Bar]]]] [[Foo|x [[Bar]] x]] @@ -20816,37 +20993,43 @@ parsoid [[Foo|x [[ y]] [[Foo|x ]] y]] [[Foo|x ]] y [[ z]] -!! html -[Foobar] -Foobar] -x [Foobar] x -x [http://google.com g] x -[[Bar]] -x [[Bar]] x -|Bar -]]bar -[[bar -x [[ y -x ]] y -x ]] y [[ z +!! html/php +

                    Foobar] +x [http://google.com g] x +[[Bar]] +x [[Bar]] x +|Bar +]]bar +[[bar +x [[ y +x ]] y +x ]] y [[ z +

                    !! end !! test Links 3. WikiLinks: No escapes needed -!! options -parsoid !! wikitext [[Foo|[Foobar]] [[Foo|foo|bar]] -!! html -[Foobar -foo|bar +!! html/php +

                    [Foobar +foo|bar +

                    +!! html/parsoid +

                    [Foobar +foo|bar

                    !! end !! test Links 4. ExtLinks: Escapes needed !! options -parsoid +parsoid=html2wt +!! html/parsoid +

                    [google] +google]

                    +

                    [http://google.com]

                    +

                    [http://google.com google]

                    !! wikitext [http://google.com [google]] [http://google.com google]] @@ -20855,21 +21038,23 @@ parsoid [http://google.com google] -!! html -

                    [google] -google]

                    -

                    [http://google.com]

                    -

                    [http://google.com google]

                    +!! html/php +

                    [google] +google] +

                    [http://google.com] +

                    [http://google.com google] +

                    !! end !! test Links 5. ExtLinks: No escapes needed -!! options -parsoid !! wikitext [http://google.com [google] -!! html -[google +!! html/php +

                    [google +

                    +!! html/parsoid +

                    [google

                    !! end !! test @@ -20926,61 +21111,90 @@ y (http://example.com) foo http://example.com, http://example.com, foo +!! html/php +

                    x +http://example.com +y +"http://example.com" +(http://example.com) +(http://example.com) foo +http://example.com, +http://example.com, foo +

                    !! end -## Parsoid currently fails wt2html on this one! !! test Links 7b. Don't add spurious s between text-nodes and url-links (bug 64300) !! html/parsoid -

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

                    +

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

                    !! wikitext -http://example.com.,;:!? +http://example.com.,;:!?\ +-http://example.com: +!! html/php +

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

                    !! end !! test Links 8. Add s between text-nodes and RFC-links when required (bug 64300) !! html/parsoid -

                    RFC 1234

                    +

                    RFC 1234 +RFC 123y +XRFC 123y

                    !! wikitext RFC 1234 +RFC 123y +XRFC 123y !! end !! test Links 9. Don't add spurious s between text-nodes and RFC-links (bug 64300) !! html/parsoid -

                    xRFC 123y -XRFC 123y -RFC 123?foo +

                    RFC 123?foo RFC 123&foo +-RFC 123-

                    !! wikitext -xRFC 123y -XRFC 123y RFC 123?foo RFC 123&foo +-RFC 123- +!! html/php +

                    RFC 123?foo +RFC 123&foo +-RFC 123- +

                    !! end !! test Links 10. Add s between text-nodes and PMID-links when required (bug 64300) !! html/parsoid

                    PMID 1234 +PMID 123y +XPMID 123y !! wikitext PMID 1234 +PMID 123y +XPMID 123y !! end !! test Links 11. Don't add spurious s between text-nodes and PMID-links (bug 64300) !! html/parsoid -

                    xPMID 123y -XPMID 123y -PMID 123?foo +

                    PMID 123?foo PMID 123&foo +-PMID 123-

                    !! wikitext -xPMID 123y -XPMID 123y PMID 123?foo PMID 123&foo +-PMID 123- +!! html/php +

                    PMID 123?foo +PMID 123&foo +-PMID 123- +

                    !! end !! test @@ -20988,24 +21202,27 @@ Links 12. Add s between text-nodes and ISBN-links when required (bug 64 !! html/parsoid

                    ISBN 12345678901 ISBN 1234567890x -ISBN 1234567890b +aISBN 1234567890b

                    !! wikitext ISBN 12345678901 ISBN 1234567890x -ISBN 1234567890b +aISBN 1234567890b !! end !! test -Links 12. Don't add spurious s between text-nodes and ISBN-links (bug 64300) +Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300) !! html/parsoid -

                    ISBN 1234567890's +

                    -ISBN 1234567890's !! wikitext -ISBN 1234567890's +-ISBN 1234567890's +!! html/php +

                    -ISBN 1234567890's +

                    !! end !! test -Links 13: Protect link-like plain text. (Parsoid bug T78425) +Links 14. Protect link-like plain text. (Parsoid bug T78425) !! options parsoid=html2wt !! html/* @@ -21015,6 +21232,18 @@ parsoid=html2wt this is not a link: http://example.com !! end +!! test +Links 15. Link trails can't become link prefixes. +!! options +language=is +!! wikitext +[[Söfnuður]]-[[00]] +!! html/php +

                    Söfnuður-00 +

                    +!! html/parsoid +

                    Söfnuður-00

                    +!! end #### --------------- Quotes --------------- #### 1. Quotes inside and @@ -21027,24 +21256,25 @@ this is not a link: http://example.com !! options parsoid=html2wt,wt2wt !! wikitext -'''foo''' +'''foo''' ''''foo'''' '''''foo''''' ''foo'''s -''''foo'''' +''''foo'''' '''''foo''''' ''''''foo'''''' '''foo'''bar'''baz''' '''foo''''s '''foo'' ''foo''' -''foo'''' -'''foo''' +''foo'''' +'''foo''' ''''foo''' '''foo'''' -''''foo'''' +''''foo'''' ''fools' errand'' ''fool's errand'' +'''foo'' bar '''baz'' a|!*#-:;+-~[]{}b'''x'' !! html/*

                    'foo' @@ -21065,12 +21295,13 @@ a|!*#-:;+-~[]{}b'''x'' 'foo' fools' errand fool's errand +'foo bar 'baz a|!*#-:;+-~[]{}b'x

                    !! end !! test -1b. Quotes inside and with other chars +1b. Quotes inside and with other tags on same line !! options parsoid=html2wt,wt2wt !! wikitext @@ -21078,11 +21309,17 @@ parsoid=html2wt,wt2wt ''a''' foo ''[[bar]]'' ''a''' foo '''{{echo|[[bar]]}}''' [[foo]] x'''[[bar]]'' +'''foo'' test +'''foo''
                    test
                    +'''foo'' and
                    bar !! html 'a foo bar a' foo bar a' foo bar foo x'bar +'foo [1] +'foo
                    test
                    +'foo and
                    bar !! end !! test @@ -21197,7 +21434,7 @@ parsoid foo ''a'' b !! html -

                    foo [1]

                    +

                    foo [1]

                    !! end !! test @@ -21245,22 +21482,22 @@ parsoid=html2wt 1. Valid behavior switches should be escaped !! options parsoid=html2wt -!! wikitext -__TOC__ -''__TOC__'' !! html __TOC__ __TOC__ +!! wikitext +__TOC__ +''__TOC__'' !! end !! test 2. Invalid behavior switches should not be escaped !! options parsoid=html2wt -!! wikitext +!! html __TOO__ __|__ -!! html +!! wikitext __TOO__ __|__ !! end @@ -21634,6 +21871,29 @@ Indented table with an empty td !!end +## We have some newline diffs RT-ing this edge case +## and it is not important enough -- we seem to be emitting +## at most 2 newlines after a and this is unrelated to +## the issue from T85627 that this is testing. +!!test +Indented table with blank lines in between (T85627) +!! options +parsoid=wt2html +!! wikitext + {| + |foo + + + |} +!! html + + + +
                    foo +
                    + +!!end + !!test Indented block & table !! wikitext @@ -21733,6 +21993,10 @@ Multi-line image caption generated by templates with/without trailing newlines New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly !! options parsoid=html2wt +!! html +

                    new para

                    + +

                    new heading

                    !! wikitext foo new para @@ -21740,10 +22004,6 @@ new para [[./Category:Foo]] = new heading = -!! html -

                    new para

                    - -

                    new heading

                    !! end ## PHP emits broken html for this, and since this is primarily @@ -22024,10 +22284,10 @@ Properly encapsulate empty-content transclusions in fosterable positions Support element with .data attribute !!options parsoid=html2wt -!! wikitext - !! html +!! wikitext + !!end !! test @@ -22053,10 +22313,10 @@ Don't block XML namespace declaration Serialize interwiki links pointing to the current wiki as plain wiki links (bug 65869) !! options parsoid=html2wt -!! wikitext -[[Foo]] !! html

                    Foo

                    +!! wikitext +[[Foo]] !! end !! test @@ -22259,10 +22519,10 @@ parsoid #!! options #parsoid=html2wt #language=ar -#!! wikitext -#[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] #!! html #
                    +#!! wikitext +#[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] #!! end !! test @@ -22359,28 +22619,41 @@ parsoid=html2wt Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does) !! options parsoid=html2wt -!! wikitext -* foo !! html
                    • foo

                    +!! wikitext +* foo !! end !! test Lists: Serialize correctly even when list tags has unneeded whitespace between tags !! options parsoid=html2wt -!! wikitext -* foo !! html
                    • foo
                    +!! wikitext +* foo !! end !! test Don't strip leading whitespace when handling indent-pre suppressing tags !! options parsoid=html2wt +!! html + + +
                    indented row
                    +

                    + This is very bold of you! +

                    +
                    + indented cell (no pre-wrapping!) +
                    +
                    +

                    foo

                    +
                    bar
                    !! wikitext {| | indented row @@ -22395,19 +22668,6 @@ parsoid=html2wt foo
                    bar
                    -!! html - - -
                    indented row
                    -

                    - This is very bold of you! -

                    -
                    - indented cell (no pre-wrapping!) -
                    -
                    -

                    foo

                    -
                    bar
                    !! end !! test @@ -22446,33 +22706,38 @@ foo Lists: Add space after bullets !! options parsoid=html2wt -!! wikitext -* foo -* bar -* baz !! html
                    • foo
                    • bar
                    • baz
                    +!! wikitext +* foo +* bar +* baz !! end !! test Lists: Dont insert newlines in a serialized list item. !! options parsoid=html2wt +!! html +
                    • a
                      b
                    • c
                    !! wikitext * a
                    b * c -!! html -
                    • a
                      b
                    • c
                    !! end !! test Headings: Add space before/after == (Bug 51744) !! options parsoid=html2wt +!! html +

                    foo

                    +

                    bar

                    +

                    baz

                    +

                    baz

                    !! wikitext == foo == @@ -22481,25 +22746,12 @@ parsoid=html2wt == baz == == baz == -!! html -

                    foo

                    -

                    bar

                    -

                    baz

                    -

                    baz

                    !! end !! test Parsoid: Serialize positional parameters with = in them as named parameter !! options parsoid=html2wt -!! wikitext -{{echo|1 = f=oo}} - -{{echo|1 = f=oo|2 = bar}} - - - -{{echo|f=oo|bar}} !! html

                    foo

                    @@ -22510,12 +22762,37 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},

                    foo

                    +!! wikitext +{{echo|1 = f=oo}} + +{{echo|1 = f=oo|2 = bar}} + + + +{{echo|f=oo|bar}} +!! end + +!! test +Parsoid: Serialize positional parameters with = in extlink as named parameter +!! options +parsoid=html2wt +!! html +

                    http://stuff?is=ok

                    +!! wikitext +{{echo|1 = http://stuff?is=ok}} !! end !! test Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes !! options parsoid=html2wt +!! html +
                    a

                    b

                    +
                    a +

                    b

                    +
                    +a +

                    b

                    !! wikitext
                    a b @@ -22528,23 +22805,16 @@ a b
                    -!! html -
                    a

                    b

                    -
                    a -

                    b

                    -
                    -a -

                    b

                    !! end !! test Substrings resembling wikitext in hrefs should not get nowiki escapes !! options parsoid=html2wt -!! wikitext -[[Foo''bar''baz]] !! html Foo''bar''baz +!! wikitext +[[Foo''bar''baz]] !! end #----------------------------- @@ -22555,6 +22825,15 @@ parsoid=html2wt 1. I/B quote minimization: wikitext-only tags should be combined !! options parsoid=html2wt +!! html +

                    AB

                    +

                    AB

                    +

                    AB

                    +

                    AB

                    +

                    ABCD

                    +

                    AB

                    +

                    AB

                    +

                    AB

                    !! wikitext ''AB'' @@ -22571,57 +22850,48 @@ parsoid=html2wt '''''AB''''' '''''AB''''' -!! html -

                    AB

                    -

                    AB

                    -

                    AB

                    -

                    AB

                    -

                    ABCD

                    -

                    AB

                    -

                    AB

                    -

                    AB

                    !! end !! test 2. I/B quote minimization: wikitext and html tags should not be combined !! options parsoid=html2wt +!! html +

                    AB

                    +

                    AB

                    !! wikitext ''A''B ''A'''''B''' -!! html -

                    AB

                    -

                    AB

                    !! end !! test 3. I/B quote minimization: templated content stops minimization !! options parsoid=html2wt +!! html +

                    AB +

                    AB !! wikitext ''A''{{echo|''B''}} ''A''{{echo|'''''B'''''}} -!! html -

                    AB -

                    AB !! end !! test 4. I/B quote minimization: new content should be mimimized with adjacent old content !! options parsoid=html2wt +!! html +

                    AB

                    +

                    AB

                    +

                    AB

                    !! wikitext ''AB'' '''AB''' ''A'''B''''' -!! html -

                    AB

                    -

                    AB

                    -

                    AB

                    !! end !! test @@ -22675,16 +22945,6 @@ parsoid=html2wt Magic words !! options parsoid=html2wt -!! wikitext -__TOC__ -__NOTOC__ -__FORCETOC__ -__INDEX__ -__NOINDEX__ -__NOGALLERY__ -__NOEDITSECTION__ -__NOTITLECONVERT__ -__NOCONTENTCONVERT__ !! html @@ -22696,12 +22956,34 @@ __NOCONTENTCONVERT__ +!! wikitext +__TOC__ +__NOTOC__ +__FORCETOC__ +__INDEX__ +__NOINDEX__ +__NOGALLERY__ +__NOEDITSECTION__ +__NOTITLECONVERT__ +__NOCONTENTCONVERT__ !! end !! test Consecutive
                    s should not get merged
                     !! options
                     parsoid=html2wt,html2html
                    +!! html
                    +
                    a
                    b
                    + +
                    c
                    +
                    +d
                    + +
                    e
                    +
                    +
                    +
                    +f
                    !! wikitext a @@ -22716,68 +22998,106 @@ parsoid=html2wt,html2html f -!! html -
                    a
                    b
                    - -
                    c
                    -
                    -d
                    - -
                    e
                    -
                    -
                    -
                    -f
                    !! end !! test Edited ISBN links not serializable as ISBN links should serialize as wikilinks !! options parsoid=html2wt -!! wikitext -[[Special:BookSources/1234567890|ISBN 1234567895]] !! html ISBN 1234567895 +!! wikitext +[[Special:BookSources/1234567890|ISBN 1234567895]] !! end !! test Edited RFC links not serializable as RFC links should serialize as extlinks !! options parsoid=html2wt -!! wikitext -[//tools.ietf.org/html/rfc123 New RFC] !! html New RFC +!! wikitext +[//tools.ietf.org/html/rfc123 New RFC] !! end !! test Edited PMID links not serializable as PMID links should serialize as extlinks !! options parsoid=html2wt -!! wikitext -[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] !! html New PMID +!! wikitext +[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID] !! end !! test -Edited Redirect link should emit a non-piped wikitext link +WTS of autolinks with trailing/surrounding context !! options parsoid=html2wt +!! html/parsoid +

                    http://cscott.netfoo

                    +

                    http://cscott.netfoo

                    +

                    http://cscott.net

                    +

                    http://cscott.net

                    +

                    http://cscott.netx

                    +

                    http://cscott.netx

                    !! wikitext -#REDIRECT [[Bar]] +http://cscott.net'''foo''' + +http://cscott.netfoo + +'''http://cscott.net''' + +'''http://cscott.net ''' + +'''http://cscott.netx''' + +http://cscott.netx +!! end + +!! test +WTS of autolinks with nowikis (round-trip) +!! wikitext +xhttp://cscott.netx +!! html/parsoid +

                    xhttp://cscott.netx

                    +!! end + +# this is the "easy" test because it leaves in place all the +# data-parsoid information indicating this is an autolink +!! test +WTS of autolinks with escapes (editing) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "meta", "remove" ] + ] +} +!! wikitext +xhttp://cscott.netx +!! wikitext/edited +xhttp://cscott.netx +!! end + +!! test +Edited Redirect link should emit a non-piped wikitext link +!! options +parsoid=html2wt !! html +!! wikitext +#REDIRECT [[Bar]] !! end !! test T75121: Infer extension name from typeOf if data-mw is not present !! options parsoid=html2wt -!! wikitext - !! html
                    +!! wikitext + !! end # ----------------------------------------------------------------- -- 2.20.1