X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=2e1806da580df04adbc0fad0942b4b267ba930eb;hb=4d0dd38e91d6a2308f41329bfd89fb0c186e5260;hp=18d9aa85e057b7517b513f6f5ae2b1f6e430f176;hpb=1eb99044c35cb0c06ce16989a9bfafb3a7a1b21a;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 18d9aa85e0..2e1806da58 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -118,6 +118,13 @@ Template:echo_with_div
{{{1}}}
!! endarticle +!! article +Template:blank_param +!! text +{{{1}}} +{{{}}} +!! endarticle + !! article Template:table_attribs !! text @@ -153,6 +160,22 @@ Template:table_attribs_5 |style="color:red;"||Bar !! endarticle +!! article +Template:table_attribs_6 +!! text +style="background: + + +red;" | +!! endarticle + +!! article +Template:table_attribs_7 +!! text + +|style{{=}}"background:#f9f9f9;"|Foofoo +!! endarticle + !! article Template:table_header_cells !! text @@ -165,6 +188,13 @@ Template:table_cells {{table_attribs}}||style='color:red;'|''Bar''||style='color:brown;'|''Foo'' and Baz !! endarticle +!! article +Template:PartialTable +!! text +{| +|- +!! endarticle + !! article Template:image_attribs !! text @@ -1300,7 +1330,7 @@ Non-word characters don't terminate tag names + tidy Non-word characters are valid in extension tags (T19663) !! wikitext tåg -!! html +!! html/php
 'tåg'
 array (
@@ -1311,11 +1341,15 @@ array (
 
 !! test
 Isolated close tags should be treated as literal text (bug 52760)
+!! options
+parsoid=wt2html
 !! wikitext
 
 
 s
-!! html+tidy
+!! html/php+tidy
+

<s.foo>s

+!! html/parsoid

<s.foo>s

!! end @@ -1349,9 +1383,11 @@ Bare pipe character from a template (bug 52363) unordered list !! wikitext * This is not an unordered list item. -!! html +!! html/php

* This is not an unordered list item.

+!! html/parsoid +

* This is not an unordered list item.

!! end !! test @@ -1364,7 +1400,7 @@ sed abit. :and a colon
-!! html +!! html/php

Lorem ipsum dolor sed abit. @@ -1373,6 +1409,14 @@ sed abit. :and a colon

+!! html/parsoid +

Lorem ipsum dolor + +sed abit. + sed nullum. + +:and a colon +

!! end !! test @@ -1386,7 +1430,7 @@ nowiki 3 *There is not nowiki. *There is nowiki. -!! html +!! html/php
There is not nowiki.
There is nowiki.
  1. There is not nowiki.
  2. @@ -1394,6 +1438,15 @@ nowiki 3
    • There is not nowiki.
    • There is nowiki.
    +!! html/parsoid +
    There is not nowiki.
    +
    There is nowiki.
    + +
    1. There is not nowiki.
    2. +
    3. There is nowiki.
    + +
    • There is not nowiki.
    • +
    • There is nowiki.
    !! end !! test @@ -1422,7 +1475,17 @@ parsoid=html2wt !! html

    * </nowiki> tag

    !! wikitext -* </nowiki> tag +* </nowiki> tag +!! end + +!! test +T93824: Put escaped HTML tags inside nowiki +!! options +parsoid=html2wt +!! html +

    <h2>foo</h2>

    +!! wikitext +

    foo

    !! end !! test @@ -1483,6 +1546,30 @@ parsoid=html2wt {{echo|a }}} !! end +!! test +Cases where "!!" needs nowiki protection +!! options +parsoid=html2wt +!! html + + +
    this needs protection !! here
    + + + +
    this does not need +protection !! here
    +!! wikitext +{| +!this needs protection !! here +|} + +{| +!this does not need +protection !! here +|} +!! end + ### ### Comments ### @@ -1587,8 +1674,10 @@ Comment whitespace Comment semantics and delimiters !! wikitext -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -1596,8 +1685,11 @@ Comment semantics and delimiters, redux !! wikitext -!! html +!! html/php +!! html/parsoid + !! end !! test @@ -1607,39 +1699,68 @@ Comment semantics and delimiters: directors cut everything starting with < followed by !-- until the first -- and > we see, that wouldn't be valid XML however, since in XML -- has to terminate a comment -->--> -!! html +!! html/php

    -->

    +!! html/parsoid +

    -->

    !! end !! test Comment semantics: nesting !! wikitext --> -!! html +!! html/php

    -->

    +!! html/parsoid +

    -->

    !! end +# Parsoid closes the unclosed comment, even if it means a slight +# round-trip diff. !! test Comment semantics: unclosed comment at end +!! options +parsoid=wt2html,html2html !! wikitext !! end -# Bug 58184: document parsoid's behaviour !! test -Suppress comment closing tag in lenient browsers -!! options -parsoid=wt2html,html2html +Comment semantics: normalize comments to play nice with XML and browsers !! wikitext - think this is closed --> + think this is closed --> + This would normally be text --> + As would this --> + + +But this is not a comment. !! html/php +

    But this is not a comment. +

    +!! html/parsoid + + + + + +

    But this is not a comment.

    +!! end +!! test +Comment semantics: round-trip even text which contains encoded --> +!! wikitext + !! html/parsoid - + !! end !! test @@ -1683,9 +1804,10 @@ parsoid=wt2html,wt2wt *a *b !! html -
      +
      • a
      • +
      • b
      @@ -1894,7 +2016,7 @@ a [[Category:A1]] [[Category:A2]] [[Category:A4]] !! html/parsoid

      a

      - + !! end !! test @@ -1904,7 +2026,7 @@ parsoid=wt2html !! wikitext [[Category:A1]]a !! html/parsoid -

      a

      +

      a

      !! end ### @@ -2140,7 +2262,7 @@ Entities inside
       
       
      -!! html +!! html/php
       <nowiki>
       
      @@ -2153,6 +2275,18 @@ Entities inside
       
       </pre>
       

      +!! html/parsoid +
      <nowiki>
      +
      +

      </nowiki> +</pre>

      + +

      +<pre> +<nowiki> +</pre> + +</pre>

      !! end !! test @@ -2671,7 +2805,7 @@ parsoid !! wikitext {{echo|a : b}} !! html -

      a : b

      +

      a : b

      !! end ## Bug T73412 @@ -2686,6 +2820,19 @@ Templates: Preserve blank parameter names

      {{{1}}}

      !! end +!! test +Templates: Preserve blank parameter names in other positions +!! wikitext +{{blank_param|bar|=foo}} +!! html/php +

      bar +foo +

      +!! html/parsoid +

      bar +foo

      +!! end + ### ### Parsoid-centric tests for testing RT edge cases for pre ### @@ -3136,9 +3283,9 @@ parsoid=wt2html,wt2wt !! wikitext [[Category:foo]] {{echo| [[Category:foo]]}} -!! html - - +!! html/parsoid + + !! end !! test @@ -3149,9 +3296,20 @@ parsoid=wt2html,wt2wt [[Category:foo]] a [[Category:foo]] {{echo|b}} !! html -
      - a
      - b
      +
       a
      +  b
      +!! end + +!! test +Indent-Pre: Newlines in comments shouldn't affect sol state +!! wikitext +a b +!! html/parsoid +

      a b

      !! end ### @@ -3290,7 +3448,7 @@ HTML-pre: 3: other wikitext '' no-italic '' [[ NoLink ]]
      -!! html +!! html/php
       * foo
       # bar
      @@ -3299,6 +3457,13 @@ HTML-pre: 3: other wikitext
       [[ NoLink ]]
       
      +!! html/parsoid +
      * foo
      +# bar
      += no-h =
      +'' no-italic ''
      +[[ NoLink ]]
      +
      !!end ### @@ -3570,20 +3735,26 @@ Definition Lists: Hacky use to indent tables, with comment before table !! end -# Bug 52473 +# The trailing whitespace in this test is to catch a regression in +# Parsoid after T54473. !! test Definition Lists: Hacky use to indent tables (WS-insensitive) -!! options -parsoid !! wikitext : {| |a |} -!! html -
      -
      a
      -
      +!! html/php +
      + +
      a +
      + +!! html/parsoid +
      + +
      a
      !! end + ## The PHP parser treats : items (dd) without a corresponding ; item (dt) ## as an empty dt item. It also ignores all but the last ";" when followed ## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in @@ -4006,6 +4177,9 @@ Definition Lists: Mixed Lists: Test 11 # Another case where tidy converts a
      to a
      (but Parsoid doesn't). +# From whitelist: +# * The test is wrong, there are two colons where there should be :; +# * The PHP parser is wrong to close the
      after the
      containing the
        . !! test Definition Lists: Weird Ones: Test 1 !! wikitext @@ -4063,7 +4237,7 @@ Definition Lists: Weird Ones: Test 1
        -
        foo 
        +
        foo 
        bar (who uses this?)
      @@ -4120,6 +4294,17 @@ Definition Lists: colons occurring in tags +!! html/parsoid +
      a
      b
      +
      a:b
      +
      a:b
      +
      a:b
      +
      a:b
      +
      a
      +
      b
      +
      a:b
      +
      a:b +
      a:b
      !! end !! test @@ -4440,6 +4625,25 @@ http://example.com/url_with_entity< http://example.com/url_with_entity<

      !! end +!! test +External links: Lone protocols are never linked (T105697) +!! wikitext +http:// +http://; +(http://) +bitcoin: +bitcoin:; +(bitcoin:) +!! html +

      http:// +http://; +(http://) +bitcoin: +bitcoin:; +(bitcoin:) +

      +!! end + !! test External links: No preceding word characters allowed (bug 65278) !! wikitext @@ -5208,15 +5412,55 @@ Parenthesis in external links, w/ transclusion or comment !! end !! test -Replace invalid link targets when serializing +Serialize tags with invalid link targets as plain text !! options parsoid=html2wt !! html -Manual +text +*text +[[foo]] +*a [[foo]] +!! wikitext +text +*text +[[foo]] +*a [[foo]] +!! end + +!! test +mw:ExtLink -vs- mw:WikiLink (T94723) +!! options +parsoid=html2wt +!! html/parsoid +Bar +Bar +Bar +Bar +

      +European Robin +European Robin +

      +!! wikitext +[[Foo|Bar]] +[[Foo|Bar]] +[[wikipedia:Foo|Bar]] +[[wikipedia:Foo|Bar]] + +[[wikipedia:European_Robin|European Robin]] +[[wikipedia:European_Robin|European Robin]] +!! end + +!! test +mw:ExtLink linking to a interwiki URL can be round-tripped losslessly (T94723) +!! options +parsoid=wt2wt !! wikitext -[[MediaWiki:Badtitletext|Manual]] +[http://en.wikipedia.org/wiki/European_Robin European Robin] +!! html/parsoid +THIS SECTION IS NOT USED (but Parsoid won't run the test without it) !! end + ### ### Quotes ### @@ -5280,7 +5524,9 @@ Plain ''italic'''s plain

      Bold tag left open

      Italic tag left open

      Normal text. -

      This year's election should beat last year's. +

      + +

      This year's election should beat last year's.

      Toms car is bigger than Susans.

      Plain italic's plain

      @@ -5480,6 +5726,7 @@ Simple table but with multiple dashes for row wikitext !! end + !! test Multiplication table !! wikitext @@ -5600,6 +5847,69 @@ Accept "||" in indented table headings !! end +!! test +Accept "!!" in templates +!! wikitext +{| +!a {{echo|b!!c}} +|} +!! html/php + + + +
      a bc +
      + +!! html/parsoid + + +!! end + +!! test +Accept "!!" in table headings after newline +!! wikitext +{| +!a +b!!c +|} +!! html/php +
      a bc
      + +
      a +

      b!!c +

      +
      + +!! html/parsoid + + +
      a +

      b!!c

      +!! end + +!! test +Accept "!!" in table data of mixed wikitext / html syntax +!! wikitext +{| +!a +b!!c +|} +!! html+tidy + + + + + + + +
      a
      b!!c
      +!! html/parsoid + + + +
      a
      b!!c
      +!! end + !! test Accept empty attributes in td/th cells (td/th cells starting with leading ||) !! wikitext @@ -5746,6 +6056,26 @@ Invalid attributes in table cell (bug 1830) !! end +!! test +Table cell attributes: Pipes protected by nowikis should be treated as a plain character +!! wikitext +{| +| title="foo" |bar +| title="foo|" |bar +| title="foo|" bar +|} +!! html + + + + +
      bar +bar + title="foo|" bar +
      + +!! end + # The "|}" to close the table is missing from the input, so parsoid's # *2wt modes will fail. !! test @@ -5893,22 +6223,66 @@ Indented table markup mixed with indented pre content (proposed in bug 6200) !! end !! test -Table with row followed by newlines and table heading +4. Template-generated table cell attributes and cell content inside a templated table !! wikitext -{| +{{tbl-start}} +!align=center {{table_header_cells}} |- - -! foo -|} -!! html +|align=center {{table_cells}} +{{tbl-end}} +!! html/php - - -
      foo -
      +Foo +Bar +Foo and Baz + + +Foo +Bar +Foo and Baz + -!! end +!! html/parsoid + + + + +
      FooBarFoo and Baz
      FooBarFoo and Baz
      +!! end + +## Edge case fix to prevent future regressions +!! test +T107652: s in templates that also generate table cell attributes should be rendered properly +!! wikitext +{| +|{{table_attribs_7}} +|} + +!! html/parsoid + + +
      Foo[1]
      +
      1. ↑ foo
      +!! end + +!! test +Table with row followed by newlines and table heading +!! wikitext +{| +|- + +! foo +|} +!! html + + + + +
      foo +
      + +!! end !! test Table with empty line following the start tag @@ -6810,7 +7184,7 @@ Link containing a tilde !! wikitext [[Foo~bar]] !! html/php -

      Foo~bar +

      Foo~bar

      !! html/parsoid

      Foo~bar

      @@ -7125,7 +7499,7 @@ title=[[User:test/123]]

      b

      !! html/parsoid -

      b

      +

      b

      !! end !! test @@ -7515,7 +7889,6 @@ Blah blah blah [[ es :Spanish]] [[ ZH :Chinese]] [[es:Foo_bar]] -[[es:Foo bar]] !! html/php

      Blah blah blah

      @@ -7524,7 +7897,21 @@ Blah blah blah - +!! end + +!! test +Space and question mark encoding in interlanguage links (T95473) +!! options +parsoid=wt2html,wt2wt,html2html +!! wikitext +Blah blah blah +[[es:Foo bar?]] +!! html/php +

      Blah blah blah +

      +!! html/parsoid +

      Blah blah blah

      + !! end !! test @@ -7702,12 +8089,10 @@ Blah blah blah !! test 1. Simple redirect to page -!! options -parsoid !! wikitext #REDIRECT [[Main Page]] -!! html - +!! html/parsoid + !! end !! test @@ -7718,12 +8103,22 @@ parsoid !! end +# Not a valid redirect in PHP (although perhaps it was, once upon a time) +# This tests the Parsoid bail-out code. !! test 3. Other redirect variants !! wikitext #REDIRECT [[[[Bar]]]] !! html/parsoid - +
      1. REDIRECT [[[[Bar]]]]
      +!! end + +!! test +4. Redirect to a templated destination +!! wikitext +#REDIRECT [[{{echo|Foo}}bar]] +!! html/parsoid + !! end !! test @@ -7732,7 +8127,7 @@ Empty redirect parsoid=wt2html,wt2wt !! wikitext #REDIRECT [[]] -!! html +!! html/parsoid
      1. REDIRECT [[]]
      !! end @@ -7745,8 +8140,8 @@ Optional colon in #REDIRECT parsoid=wt2html,html2html !! wikitext #REDIRECT:[[Main Page]] -!! html - +!! html/parsoid + !! end !! test @@ -7761,8 +8156,8 @@ parsoid=wt2html,html2html #REDIRECT : [[Main Page]] -!! html - +!! html/parsoid + !! end !! test @@ -7773,89 +8168,90 @@ Piped link in #REDIRECT parsoid=wt2html !! wikitext #REDIRECT [[Main Page|bar]] -!! html - +!! html/parsoid + !! end !! test -Redirect to category +Redirect to category (T104502) !! options -parsoid=wt2wt,wt2html +parsoid=wt2html,wt2wt !! wikitext #REDIRECT [[Category:Foo]] -!! html - +!! html/parsoid + !! end !! test -Redirect to category with URL encoding +Redirect to category with URL encoding (T104502) !! options parsoid=wt2html !! wikitext #REDIRECT [[Category%3AFoo]] -!! html - +!! html/parsoid + !! end !! test Redirect to category page -!! options -parsoid !! wikitext #REDIRECT [[:Category:Foo]] -!! html - +!! html/parsoid + !! end !! test Redirect to image page (1) -!! options -parsoid !! wikitext #REDIRECT [[File:Wiki.png]] -!! html - +!! html/parsoid + !! end !! test Redirect to image page (2) -!! options -parsoid !! wikitext #REDIRECT [[Image:Wiki.png]] -!! html - +!! html/parsoid + !! end +# html2wt disabled because wts serializes as "#REDIRECT [[:en:File:Wiki.png]]" +# Next test confirms this. !! test -Redirect to language +Redirect to language (1) (T104918) !! options -parsoid +parsoid=wt2html,wt2wt,html2html !! wikitext #REDIRECT [[en:File:Wiki.png]] -!! html - +!! html/parsoid + !! end !! test -Redirect to interwiki -!! options -parsoid +Redirect to language (2) (T104918) +!! wikitext +#REDIRECT [[:en:File:Wiki.png]] +!! html/parsoid + +!! end + +!! test +Redirect to interwiki (T104918) !! wikitext #REDIRECT [[meatball:File:Wiki.png]] -!! html - +!! html/parsoid + !! end !! test Non-English #REDIRECT !! options -parsoid language=is !! wikitext #TILVÍSUN [[Main Page]] -!! html - +!! html/parsoid + !! end !! test @@ -7874,8 +8270,8 @@ some text New redirect !! options parsoid=html2wt -!! html -

      Foo

      +!! html/parsoid +

      Foo

      !! wikitext Foo #REDIRECT [[Foo]] @@ -7980,8 +8376,8 @@ Handling html with a br self-closing tag

      !! html/php -


      -
      +


      +



      @@ -8225,7 +8621,7 @@ parsoid !! wikitext * !! html/parsoid -

        +
          !! end !! test @@ -8258,11 +8654,15 @@ List items are not parsed correctly following a
           block (bug 785)
           * 
          foo
          *
          bar
          * zar -!! html +!! html/php
          • foo
          • bar
          • zar
          +!! html/parsoid +
          • foo
          • +
          • bar
          • +
          • zar
          !! end !! test @@ -9306,7 +9706,7 @@ hi+world%3F%21 Magic Word: prioritize type info over data-parsoid !! options parsoid=html2wt -!! html +!! html/parsoid !! wikitext __FORCETOC__ @@ -9335,6 +9735,15 @@ __NOEDITSECTION__ !! end +!!test +__proto__ is treated as normal wikitext (T105997) +!!wikitext +__proto__ +!!html +

          __proto__ +

          +!!end + ### ### Magic links ### @@ -9642,9 +10051,11 @@ Template with default value (value set) Template redirect !! wikitext {{templateredirect}} -!! html +!! html/php

          (test)

          +!! html/parsoid + !! end !! test @@ -9882,6 +10293,24 @@ Template with targets containing wikilinks

          !! end +!! article +Template:'' +!! text +bar +!! endarticle + +!! test +Templates: Double quotes as template target +!! wikitext +foo {{''}} baz +!! html/php +

          foo bar baz +

          +!! html/parsoid +

          foo bar baz +

          +!! end + !! article Template:MSGNW test !! text @@ -9899,7 +10328,7 @@ File:Foobar.jpg msgnw keyword !! wikitext {{msgnw:MSGNW test}} -!! html +!! html/php

          ''None'' of '''this''' should be * interpreted but rather passed unmodified @@ -10669,6 +11098,43 @@ Templates: Support for templates generating attributes and content !! end +!! test +3. Entities and nowikis inside templated attributes should be handled correctly inside templated tables +!! wikitext +{{tbl-start}} +|{{table_attribs_3}} +{{tbl-end}} +!! html/php + + +
          Foo +
          + +!! html/parsoid + + +
          Foo
          +!! end + +# T107622 +!! test +4. Entities and nowikis inside templated attributes should be handled correctly inside templated tables +!! wikitext +{| +| {{table_attribs_6}} hi +|} +!! html/php + + +
          hi +
          + +!! html/parsoid + + +
          hi
          +!! end + !!test Templates: HTML Tables: 1. Generating start of a HTML table !! wikitext @@ -10896,6 +11362,46 @@ Templates: Wiki Tables: 6. Templated tags, templated td-tags !!end +## This test case is very specific to Parsoid's internals +## and is hence only tested for Parsoid's code. Parsoid uses +## a marker tag for tags and they are expanded +## much later. We are verifying that this tag usage +## doesn't prevent foster parenting. +!!test +Templates: Wiki Tables: 7. Fosterable s should get fostered +!!wikitext +{{PartialTable}}foo +|} + + +!!html/parsoid +[1] + +
          + +

          1. ↑ foo
          +!!end + +!! test +Templates: Wiki Tables: 8. Fosterable meta-tags should get fostered +!! wikitext +{{echo| +{{{!}} +{{!}}-}} + +|foo + +{{!}}} +!! html/parsoid + + + + + +
          foo +
          +!! end + !!test Templates: Lists: Multi-line list-items via templates !! wikitext @@ -11093,41 +11599,40 @@ Parser Functions: 2. Nested use (only outermost should be marked up) !! test pre-save transform: subst: !! options -PST +pst !! wikitext {{subst:test}} -!! html +!! html/php This is a test template !! end !! test pre-save transform: normal template !! options -PST +pst !! wikitext {{test}} -!! html +!! html/php {{test}} !! end !! test pre-save transform: nonexistent template !! options -PST +pst !! wikitext {{thistemplatedoesnotexist}} -!! html +!! html/php {{thistemplatedoesnotexist}} !! end - !! test pre-save transform: subst magic variables !! options -PST +pst !! wikitext {{subst:SITENAME}} -!! html +!! html/php MediaWiki !! end @@ -11138,7 +11643,7 @@ pre-save transform: subst: templates with parameters pst !! wikitext {{subst:paramtest|param="something else"}} -!! html +!! html/php This is a test template with parameter "something else" !! end @@ -11154,11 +11659,10 @@ pre-save transform: nowiki in subst (bug 1188) pst !! wikitext {{subst:nowikitest}} -!! html +!! html/php '''not wiki''' !! end - !! article Template:commenttest !! text @@ -11171,7 +11675,7 @@ pre-save transform: comment in subst (bug 1936) pst !! wikitext {{subst:commenttest}} -!! html +!! html/php This template has in it. !! end @@ -11181,7 +11685,7 @@ pre-save transform: unclosed tag pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11191,7 +11695,7 @@ pre-save transform: mixed tag case pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11201,7 +11705,7 @@ pre-save transform: unclosed comment in pst noxml !! wikitext wikinowiki -!! html +!! html/php !!end @@ -11239,7 +11743,7 @@ pre-save transform: comment containing extension pst !! wikitext -!! html +!! html/php !!end @@ -11249,7 +11753,7 @@ pre-save transform: comment containing nowiki pst !! wikitext -!! html +!! html/php !!end @@ -11259,7 +11763,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes}} -!! html +!! html/php Foobar !! end @@ -11269,7 +11773,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes2}} -!! html +!! html/php Foo !! end @@ -11291,7 +11795,7 @@ bug 22297: safesubst: works during PST pst !! wikitext {{subst:SafeSubstTest}}{{safesubst:SubstTest}} -!! html +!! html/php FoobarFoobar !! end @@ -11327,7 +11831,7 @@ pst [[|Article (context)]] [[Bar:X (Y) Z|]] [[:Bar:X (Y) Z|]] -!! html +!! html/php [[Article (context)|Article]] [[Bar:Article|Article]] [[:Bar:Article|Article]] @@ -11348,7 +11852,7 @@ pst [[:interwiki:Article|]] [[interwiki:Bar:Article|]] [[:interwiki:Bar:Article|]] -!! html +!! html/php [[interwiki:Article|Article]] [[:interwiki:Article|Article]] [[interwiki:Bar:Article|Bar:Article]] @@ -11361,7 +11865,7 @@ pre-save transform: context links ("pipe trick") with parens in title pst title=[[Somearticle (context)]] !! wikitext [[|Article]] -!! html +!! html/php [[Article (context)|Article]] !! end @@ -11373,7 +11877,7 @@ pst title=[[Someplace, Somewhere]] [[|Otherplace]] [[Otherplace, Elsewhere|]] [[Otherplace, Elsewhere, Anywhere|]] -!! html +!! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace, Elsewhere|Otherplace]] [[Otherplace, Elsewhere, Anywhere|Otherplace]] @@ -11386,7 +11890,7 @@ pst title=[[Someplace (IGNORED), Somewhere]] !! wikitext [[|Otherplace]] [[Otherplace (place), Elsewhere|]] -!! html +!! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace (place), Elsewhere|Otherplace]] !! end @@ -11398,7 +11902,7 @@ pst title=[[Who, me? (context)]] !! wikitext [[|Yes, you.]] [[Me, Myself, and I (1937 song)|]] -!! html +!! html/php [[Yes, you. (context)|Yes, you.]] [[Me, Myself, and I (1937 song)|Me, Myself, and I]] !! end @@ -11409,7 +11913,7 @@ pre-save transform: context links ("pipe trick") with namespace pst title=[[Ns:Somearticle]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article|Article]] !! end @@ -11419,7 +11923,7 @@ pre-save transform: context links ("pipe trick") with namespace and parens pst title=[[Ns:Somearticle (context)]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article (context)|Article]] !! end @@ -11429,7 +11933,7 @@ pre-save transform: context links ("pipe trick") with namespace and comma pst title=[[Ns:Somearticle, Context, Whatever]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article, Context, Whatever|Article]] !! end @@ -11439,7 +11943,7 @@ pre-save transform: context links ("pipe trick") with namespace, comma and paren pst title=[[Ns:Somearticle, Context (context)]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article (context)|Article]] !! end @@ -11449,7 +11953,7 @@ pre-save transform: context links ("pipe trick") with namespace, parens and comm pst title=[[Ns:Somearticle (IGNORED), Context]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article, Context|Article]] !! end @@ -11464,7 +11968,7 @@ pst [[|Article(context)]] [[Bar:X(Y)Z|]] [[:Bar:X(Y)Z|]] -!! html +!! html/php [[Article(context)|Article]] [[Bar:Article(context)|Article]] [[:Bar:Article(context)|Article]] @@ -11484,7 +11988,7 @@ pst [[|Article (context)]] [[Bar:X (Y) Z|]] [[:Bar:X (Y) Z|]] -!! html +!! html/php [[Article (context)|Article]] [[Bar:Article (context)|Article]] [[:Bar:Article (context)|Article]] @@ -11504,7 +12008,7 @@ pst [[|Article(context)]] [[Bar:X(Y)Z|]] [[:Bar:X(Y)Z|]] -!! html +!! html/php [[Article(context)|Article]] [[Bar:Article(context)|Article]] [[:Bar:Article(context)|Article]] @@ -11524,7 +12028,7 @@ pst [[Bar:Article (context),context|]] [[:Bar:Article (context), context|]] [[:Bar:Article (context),context|]] -!! html +!! html/php [[Article (context), context|Article]] [[Article (context),context|Article]] [[Bar:Article (context), context|Article]] @@ -11543,7 +12047,7 @@ Empty lines are trimmed -!! html +!! html/php Empty lines are trimmed !! end @@ -11556,7 +12060,7 @@ pst * ~~~ * ~~~ * ~~~ -!! html +!! html/php * [[Special:Contributions/127.0.0.1|127.0.0.1]] * [[Special:Contributions/127.0.0.1|127.0.0.1]] * [[Special:Contributions/127.0.0.1|127.0.0.1]] @@ -11587,7 +12091,7 @@ As well as inside noinclude/onlyinclude But not inside includeonly {{subst:Foo}} -!! html +!! html/php Shall not expand: ~~~~ @@ -11921,7 +12425,7 @@ parsoid=wt2html,wt2wt,html2html
          This is a caption
          !! html/parsoid -
          This is a caption
          +
          This is a caption
          !! end !! test @@ -11932,7 +12436,7 @@ parsoid=wt2html,wt2wt,html2html
          This is a caption
          !! html/parsoid -
          This is a caption
          +
          This is a caption
          !! end !! test @@ -11989,7 +12493,7 @@ thumbsize=220 !! html/parsoid

          123456

          123

          456

          -

          123

          456

          +

          123

          456

          !! end !! test @@ -12011,7 +12515,7 @@ Image with multiple widths -- use last

          caption

          !! html/parsoid -

          +

          !! end !! test @@ -12027,7 +12531,7 @@ thumbsize=220

          caption

          !! html/parsoid -
          caption
          +
          caption

          !! end @@ -12043,9 +12547,9 @@ Image with width attribute at different positions
          Caption
          !! html/parsoid -
          Caption
          -
          Caption
          -
          Caption
          +
          Caption
          +
          Caption
          +
          Caption
          !! end # a sad bit of backward-compatibility @@ -12061,7 +12565,7 @@ parsoid=wt2html,wt2wt,html2html Foobar.jpg

          !! html/parsoid -

          +

          !! end !! test @@ -12187,7 +12691,7 @@ parsoid=wt2html,wt2wt,html2html
          Title
          !! html/parsoid -
          Title
          +
          Title
          !! end !! test @@ -12334,9 +12838,9 @@ parsoid=wt2html,wt2wt,html2html

          caption

          !! html/parsoid -

          -

          -

          +

          +

          +

          !! end !! test @@ -12372,9 +12876,9 @@ parsoid=wt2html,wt2wt,html2html
          caption
          !! html/parsoid -
          caption
          -
          caption
          -
          caption
          +
          caption
          +
          caption
          +
          caption
          !! end ################### @@ -12401,8 +12905,8 @@ parsoid=wt2html,wt2wt,html2html

          Foobar.jpg

          !! html/parsoid -

          -

          +

          +

          !! end !! test @@ -12418,8 +12922,8 @@ parsoid=wt2html,wt2wt,html2html

          Foobar.jpg

          !! html/parsoid -

          -

          +

          +

          !! end !! test @@ -12432,7 +12936,7 @@ parsoid=wt2html,wt2wt,html2html
          Foobar.jpg
          !! html/parsoid -
          +
          !! end !! test @@ -12448,8 +12952,8 @@ parsoid=wt2html,wt2wt,html2html
          Foobar.svg
          !! html/parsoid -
          -
          +
          +
          !! end !! test @@ -12462,7 +12966,7 @@ parsoid=wt2html,wt2wt,html2html

          Foobar.jpg

          !! html/parsoid -

          +

          !! end !! test @@ -12478,8 +12982,8 @@ parsoid=wt2html,wt2wt,html2html

          Foobar.svg

          !! html/parsoid -

          -

          +

          +

          !! end !! test @@ -12550,7 +13054,7 @@ thumbsize=220 !! html/parsoid -
          http://example.com
          +
          http://example.com
          !! end !! test @@ -12564,7 +13068,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid -
          Alteration
          http://example.com
          +
          Alteration
          http://example.com
          !! end !! test @@ -12576,7 +13080,7 @@ SVG thumbnails with no language set
          caption
          !! html/parsoid -
          caption
          +
          caption
          !! end !! test @@ -12589,7 +13093,7 @@ parsoid=wt2html,wt2wt,html2html
          caption
          !! html/parsoid -
          caption
          +
          caption
          !! end !! test @@ -12613,7 +13117,7 @@ BUG 1887: A ISBN with a thumbnail !! html/parsoid -
          ISBN 1235467890
          +
          ISBN 1235467890
          !! end !! test @@ -12624,7 +13128,7 @@ BUG 1887: A RFC with a thumbnail
          This is RFC 12354
          !! html/parsoid -
          This is RFC 12354
          +
          This is RFC 12354
          !! end !! test @@ -12635,7 +13139,7 @@ BUG 1887: A mailto link with a thumbnail !! html/parsoid -
          Please mailto:nobody@example.com
          +
          Please mailto:nobody@example.com
          !! end # Pending resolution to bug 368 @@ -12726,7 +13230,7 @@ Image caption containing another image
          This is a caption with another image inside it!
          !! html/parsoid -
          This is a caption with another inside it!
          +
          This is a caption with another inside it!
          !! end !! test @@ -12750,7 +13254,7 @@ Image: caption containing leading space
          bar
          !! html/parsoid -
          bar
          +
          bar
          !!end !! test @@ -12769,7 +13273,7 @@ and some more text.]]
          This is an example image thumbnail caption with a table
          Foo Bar
          Foo1 Bar1
          and some more text.
          !! html/parsoid -
          This is an example image thumbnail caption with a table +
          This is an example image thumbnail caption with a table @@ -12786,7 +13290,7 @@ Bug 3090: External links other than http: in image captions
          This caption has irc and Secure ext links in it.
          !! html/parsoid -
          This caption has irc and Secure ext links in it.
          +
          This caption has irc and Secure ext links in it.
          !! end !! test @@ -12828,7 +13332,7 @@ language=es
          caption
          !! html/parsoid -
          caption
          +
          caption
          !! end !! test @@ -12842,7 +13346,7 @@ parsoid=wt2html,wt2wt,html2html

          caption

          !! html/parsoid -

          +

          !! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -12863,9 +13367,9 @@ parsoid=wt2html,wt2wt,html2html
          caption
          !! html/parsoid -
          caption
          -
          caption
          -
          caption
          +
          caption
          +
          caption
          +
          caption
          !! end !! article @@ -12910,7 +13414,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -

          +

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

          +

          !! end !! test @@ -12930,7 +13434,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid -

          +

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

          +

          !! end !! test @@ -12965,7 +13469,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 @@ -12974,7 +13478,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|thumb|left|baseline|caption content]] !! html/parsoid -
          caption content
          +
          caption content
          !! end !! test @@ -12982,7 +13486,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 @@ -13050,7 +13554,7 @@ foo bar !! html/parsoid

          foo

          -
          This caption has a
          unbalanced tag in it.
          +
          This caption has a
          unbalanced tag in it.

          bar

          !! end @@ -13061,7 +13565,7 @@ parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! html/parsoid -
          +
          !! end # empty captions don't get serialized unless we're in the "round trip" case @@ -13088,7 +13592,7 @@ Parsoid-specific image handling - whitespace caption !! wikitext [[File:Foobar.jpg|thumb| ]] !! html/parsoid -
          +
          !! end !! test @@ -13435,6 +13939,152 @@ Bar

          !! end +## The whitespace on the empty line is part of the test. Please do not delete +!! test +1. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87) +!! options +parsoid=wt2html,wt2wt +!! wikitext +This + +[[Category:Foo]] and this should be part of same paragraph (not an indent-pre) + +{{echo|[[Category:Foo]] and so should this!}} +!! html +

          This and this should be part of same paragraph (not an indent-pre) and so should this! +

          +!! html/parsoid +

          This + + and this should be part of same paragraph (not an indent-pre) + + and so should this!

          +!! end + +## Parsoid will not try to wt2wt this while preserving newlines because +## it suppresses excess newlines within list items -- and we don't want to +## introduce a special case just for categories, which is, in reality somewhat +## odd behavior -- categories are unlikely to be used in list items like this +## in top-level pages and are only likely to show up in template-generated +## list items where this RT-ing is a non-issue. +## +## The whitespace on the empty line is part of the test. Please do not delete +!! test +2. Categories and newlines: All preceding newlines should be suppressed (courtesy bug 87) +!! options +parsoid=wt2html +!! wikitext +* This + +[[Category:Foo]] and this should be part of the same list item +* So should this + +{{echo|[[Category:Foo]] and this should be part of the same list item}} +!! html +
          • This and this should be part of the same list item
          • +
          • So should this and this should be part of the same list item
          +!! html/parsoid +
            +
          • This and this should be part of the same list item
          • +
          • So should this and this should be part of the same list item
          • +
          +!! end + +## Newlines and categories that follow the last item of a list +## are treated differently because this (list followed by categories) +## is an extremely common pattern on wikis. +!! test +3. Categories and newlines: newline suppression for last list item should RT properly +!! wikitext +* a +* b + +[[Category:Foo]] + +[[Category:Bar]] +[[Category:Baz]] +!! html/parsoid +
          • a
          • +
          • b
          + + + + + +!! end + +!! test +4. Categories and newlines: newline suppression for last list item should RT properly +!! wikitext +* a +**** b + +[[Category:Foo]] +!! html/parsoid +
          • a +
                • b
          + + +!! end + +## only wt2html for this to make sure the algo only applies to the rightmost path +!! test +5. Categories and newlines: migrateTrailingCategories dom pass should only run on the rightmost path of nested lists +!! options +parsoid=wt2html +!! wikitext +* a +** b +[[Category:Foo]] +* c +** d +[[Category:Foo]] +!! html/parsoid +
          • a +
            • b +
          • +
          • c +
            • d
          + +!! end + +!! test +6. Categories and newlines: migrateTrailingCategories dom pass should not migrate categories not preceded by newlines +!! wikitext +* a [[Category:Foo]] +!! html/parsoid +
          • a
          +!! end + +# This test also demonstrates because of newline+category tunneling +# through the list hander, template wrapping doesn't expand to the +# containing list when the list item swallows the category. +!! test +7. Categories and newlines: migrateTrailingCategories dom pass should leave template content alone +!! wikitext +* {{echo|a +[[Category:Foo]]}} +!! html/parsoid +
          • a +
          +!! end + +!! test +8. Categories and newlines: migrateTrailingCategories dom pass should not get tripped by intervening templates +!! wikitext +* a + +{{echo|[[Category:Foo]] +[[Category:Bar]]}} +[[Category:Baz]] +!! html/parsoid +
          • a
          + + + + +!! end + !! test Parsoid: Serialize link to category page with colon escape !! options @@ -13450,15 +14100,21 @@ parsoid

          !! end +# html2wt localizes the "Category" namespace. +# XXX the element needs an empty data-parsoid attribute, or +# else the html2html test fails because spaces are inserted. !! test -Parsoid: Link prefix/suffixes aren't applied to category links +Link prefix/suffixes aren't applied to category links !! options parsoid=wt2html,wt2wt,html2html language=is !! wikitext x[[Category:Foo]]y -!! html -

          xy

          +!! html/php +

          xy +

          +!! html/parsoid +

          xy

          !! end !! test @@ -13630,7 +14286,7 @@ __FORCETOC__ == Headline == == Headline 2 == == Headline == -!! html +!! html/php

          Contents

          • 1 Headline 2
          • @@ -13744,6 +14400,22 @@ TOC regression (T11764) !! end +!! test +TOC for heading containing (T96153) +!! wikitext +__FORCETOC__ +==New title== +!! html/php +

            Contents

            + +
            + +

            New title[edit]

            + +!! end + !! test TOC with wgMaxTocLevel=3 (bug 6204) !! options @@ -14628,13 +15300,19 @@ Attribute test: unquoted but illegal value (hash)

            !! end +# Parsoid does not serialize to empty attribute syntax, +# so wt2wt and html2wt cases are skipped !! test -Attribute test: no value +Attribute test: no value (T54330) +!! options +parsoid=wt2html,html2html !! wikitext foo -!! html -

            foo +!! html/php +

            foo

            +!! html/parsoid +

            foo

            !! end !! test @@ -15063,7 +15741,7 @@ evil -wiki-tags without Extension:Math enabled Parser hook: empty input !! wikitext -!! html +!! html/php
             ''
             array (
            @@ -15076,7 +15754,7 @@ array (
             Parser hook: empty input using terminated empty elements
             !! wikitext
             
            -!! html
            +!! html/php
             
             NULL
             array (
            @@ -15089,7 +15767,7 @@ array (
             Parser hook: empty input using terminated empty elements (space before)
             !! wikitext
             
            -!! html
            +!! html/php
             
             NULL
             array (
            @@ -15102,7 +15780,7 @@ array (
             Parser hook: basic input
             !! wikitext
             input
            -!! html
            +!! html/php
             
             'input'
             array (
            @@ -15116,7 +15794,7 @@ array (
             Parser hook: case insensitive
             !! wikitext
             input
            -!! html
            +!! html/php
             
             'input'
             array (
            @@ -15130,7 +15808,7 @@ array (
             Parser hook: case insensitive, redux
             !! wikitext
             input
            -!! html
            +!! html/php
             
             'input'
             array (
            @@ -15145,7 +15823,7 @@ Parser hook: nested tags
             noxml
             !! wikitext
             
            -!! html
            +!! html/php
             
             ''
             array (
            @@ -15158,14 +15836,14 @@ array (
             Parser hook: basic arguments
             !! wikitext
             
            -!! html
            +!! html/php
             
             ''
             array (
               'width' => '200',
               'height' => '100',
               'depth' => '50',
            -  'square' => 'square',
            +  'square' => '',
             )
             
            @@ -15175,7 +15853,7 @@ array ( Parser hook: argument containing a forward slash (bug 5344) !! wikitext -!! html +!! html/php
             ''
             array (
            @@ -15189,7 +15867,7 @@ array (
             Parser hook: empty input using terminated empty elements (bug 2374)
             !! wikitext
             text
            -!! html
            +!! html/php
             
             NULL
             array (
            @@ -15206,14 +15884,14 @@ Parser hook: basic arguments using terminated empty elements (bug 2374)
             
             other stuff
             
            -!! html
            +!! html/php
             
             NULL
             array (
               'width' => '200',
               'height' => '100',
               'depth' => '50',
            -  'square' => 'square',
            +  'square' => '',
             )
             

            other stuff @@ -15230,7 +15908,7 @@ Parser hook: static parser hook not inside a comment !! wikitext hello, world -!! html +!! html/php

            hello, world

            !! end @@ -15241,7 +15919,7 @@ Parser hook: static parser hook inside a comment !! wikitext -!! html +!! html/php


            !! end @@ -15300,20 +15978,24 @@ Sanitizer: Closing of open but not closed tags !! test Sanitizer: Closing of closed but not open tags +!! options +parsoid=wt2html !! wikitext -!! html -

            </s> -

            +!! html/php+tidy +!! html/parsoid !! end !! test Sanitizer: Closing of closed but not open table tags +!! options +parsoid=wt2html !! wikitext Table not started
          Foo Bar
          -!! html -

          Table not started</td></tr></table> -

          +!! html/php+tidy +

          Table not started

          +!! html/parsoid +

          Table not started

          !! end !! test @@ -15360,7 +16042,7 @@ Sanitizer: Validating that and work, but only for Microdata !! html -
          +

          <meta http-equiv="refresh" content="5"> @@ -16112,7 +16794,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start !! end @@ -16132,7 +16814,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==a== ===aa=== ====aaa==== @@ -16154,7 +16836,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===aa=== ====aaa==== !! end @@ -16175,7 +16857,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ====aaa==== !! end @@ -16195,7 +16877,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==b== ===ba=== ===bb=== @@ -16219,7 +16901,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===ba=== !! end @@ -16239,7 +16921,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===bb=== ====bba==== !! end @@ -16260,7 +16942,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ====bba==== !! end @@ -16280,7 +16962,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===bc=== !! end @@ -16300,7 +16982,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==c== ===ca=== !! end @@ -16321,7 +17003,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===ca=== !! end @@ -16341,7 +17023,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php !! end !! test @@ -16352,7 +17034,7 @@ section=1 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==a== ==bogus== not a legal section !! end @@ -16365,7 +17047,7 @@ section=2 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==b== !! end @@ -16377,7 +17059,7 @@ section=1 ==a== ==b== ==c== -!! html +!! html/php ==a== !! end @@ -16389,7 +17071,7 @@ section=2 ==a== ==b== ==c== -!! html +!! html/php ==b== !! end @@ -16401,7 +17083,7 @@ section=1 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==a== ==bogus== not a legal section !! end @@ -16414,11 +17096,10 @@ section=2 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==b== !! end - # Formerly testing for bug 2587, now resolved by the use of unmarked sections # instead of respecting commented sections !! test @@ -16428,7 +17109,7 @@ section=1 !! wikitext ==sec1== ==sec2== -!! html +!! html/php ==sec2== !!end @@ -16439,11 +17120,10 @@ section=2 !! wikitext ==sec1== ==sec2== -!! html +!! html/php !!end - # Formerly testing for bug 2607, now resolved by the use of unmarked sections # instead of respecting HTML-style headings !! test @@ -16457,7 +17137,7 @@ unmarked one ==2== two -!! html +!! html/php ==1== one !! end @@ -16473,7 +17153,7 @@ unmarked one ==2== two -!! html +!! html/php ==2== two !! end @@ -16487,7 +17167,7 @@ section=1 !! wikitext ==unmarked== ==marked== -!! html +!! html/php ==marked== !!end @@ -16502,7 +17182,7 @@ The line above must have a trailing space === But just in case it doesn't... -!! html +!! html/php === But just in case it doesn't... @@ -16524,7 +17204,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php xxx ==a== @@ -16555,7 +17235,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start xxx @@ -16584,7 +17264,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== xxx @@ -16614,7 +17294,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16645,7 +17325,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16672,7 +17352,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16703,7 +17383,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16733,7 +17413,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16764,7 +17444,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16795,7 +17475,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16824,7 +17504,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -16846,7 +17526,7 @@ replace=2,"xxx" Preformatted initial line ==a== ===a=== -!! html +!! html/php Preformatted initial line ==a== xxx @@ -16860,7 +17540,7 @@ section=1 !! wikitext ==a== a -!! html +!! html/php ==a== a !! end @@ -16872,7 +17552,7 @@ section=1 !! wikitext ==a== a -!! html +!! html/php ==a== a !! end @@ -16890,7 +17570,7 @@ noxml section=2 == Section Two == stuff -!! html +!! html/php == Section Two == stuff !! end @@ -16907,7 +17587,7 @@ noxml replace=2,"xxx" == Section Two == stuff -!! html +!! html/php == Section One ==

           =======
          @@ -16917,7 +17597,6 @@ xxx
           !! end
           
           
          -
           !! test
           Handling of 
           in URLs
           !! wikitext
          @@ -17343,7 +18022,7 @@ __FORCETOC__ override
           !! wikitext
           __NEWSECTIONLINK__
           __FORCETOC__
          -!! html
          +!! html/php
           


          !! end @@ -17548,7 +18227,7 @@ Images with the "|" character in the comment
          An external URL
          !! html/parsoid -
          An external URL
          +
          An external URL
          !! end !! test @@ -17704,7 +18383,7 @@ Don't fall for the self-closing div MSGNW magic word !! wikitext {{MSGNW:msg}} -!! html +!! html/php

          [[:Template:Msg]]

          !! end @@ -19093,7 +19772,7 @@ percent-encoding and + signs in comments (Bug 26410) comment !! wikitext [[ABC%33D% ++]] [[ABC%33D% ++|+%20]] -!! html +!! html/php ABC3D% ++ +%20 !! end @@ -19137,7 +19816,7 @@ wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! wikitext this is not the the title -!! html +!! html/php Parser test

          this is not the the title

          @@ -19154,7 +19833,7 @@ wgRestrictDisplayTitle=false !! wikitext this is not the the title {{DISPLAYTITLE:whatever}} -!! html +!! html/php whatever

          this is not the the title

          @@ -19171,7 +19850,7 @@ wgRestrictDisplayTitle=true !! wikitext this is not the the title {{DISPLAYTITLE:whatever}} -!! html +!! html/php Screen

          this is not the the title

          @@ -19188,7 +19867,7 @@ wgRestrictDisplayTitle=true !! wikitext this is not the the title {{DISPLAYTITLE:screen}} -!! html +!! html/php screen

          this is not the the title

          @@ -19204,7 +19883,7 @@ wgAllowDisplayTitle=false !! wikitext this is not the the title {{DISPLAYTITLE:screen}} -!! html +!! html/php Screen

          this is not the the title Template:DISPLAYTITLE:screen @@ -19220,7 +19899,7 @@ title=[[Screen]] wgAllowDisplayTitle=false !! wikitext this is not the the title -!! html +!! html/php Screen

          this is not the the title

          @@ -19237,7 +19916,7 @@ wgRestrictDisplayTitle=true !! wikitext this is not the the title {{DISPLAYTITLE:screen}} -!! html +!! html/php screen

          this is not the the title

          @@ -19254,7 +19933,7 @@ wgRestrictDisplayTitle=true !! wikitext this is not the the title {{DISPLAYTITLE:screen}} -!! html +!! html/php screen

          this is not the the title

          @@ -19279,7 +19958,7 @@ Page status indicators: Weird syntaxes that are okay showindicators !! wikitext - + !! html empty= name= @@ -19342,7 +20021,7 @@ preload: check and preload !! wikitext Hello cruelkind world. -!! html +!! html/php Hello kind world. !! end @@ -19352,7 +20031,7 @@ preload: check preload !! wikitext Goodbye Hello world -!! html +!! html/php Hello world !! end @@ -19362,7 +20041,7 @@ preload: can pass tags through if we want to preload !! wikitext <includeonly>Hello world</includeonly> -!! html +!! html/php Hello world !! end @@ -19372,7 +20051,7 @@ preload: check that it doesn't try to do tricks preload !! wikitext * ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} -!! html +!! html/php * ''{{world}}'' {{subst:How are you}}{{ {{{|safesubst:}}} #if:1|2|3}} !! end @@ -19423,7 +20102,10 @@ percent-encoding and + signs in internal links (Bug 26410) 3E 3E+

          !! html/parsoid -

          User:+% Page+title% %+ %20 %+ %+r % + 3E 3E+

          +

          User:+% Page+title% +%+ %20 %+ %+r +% + +3E 3E+

          !! end !! test @@ -19830,10 +20512,12 @@ Strip marker in urlencode {{urlencode:xy}} {{urlencode:xy|wiki}} {{urlencode:xy|path}} +{{urlencode:x
          two
          y}} !! html

          xy xy xy +xy

          !! end @@ -20192,21 +20876,46 @@ parsoid=wt2html,wt2wt [[Image:Foobar.jpg|right|300px]] !! html/parsoid +

          foo

          -
          caption
          +
          caption

          bar

          -
          +
          !! end -#### ---------------------------------------------------------------- -#### Parsoid-only testing of Parsoid's impl of and -#### tags. Parsoid's output for these tags differs from that of the -#### PHP parser. -#### ---------------------------------------------------------------- - -!!test -Ref: 1. ref-location should be replaced with an index span -!!options +!! test +3. Bad treebuilder fixup of formatting elt is cleaned up +!! options +parsoid=wt2html,wt2wt +!! wikitext +'''foo[[File:Foobar.jpg|thumb|caption]]bar''' +!! html/parsoid +

          foo

          +
          caption
          +

          bar

          +!! end + +!! test +4. Bad treebuilder fixup of formatting elt is cleaned up: formatting tags around captionless images are ignored +!! options +parsoid=wt2html,wt2wt +!! wikitext +'''[[Image:Foobar.jpg|right|300px]]''' +!! html/parsoid +

          +
          +

          +!! end + +#### ---------------------------------------------------------------- +#### Parsoid-only testing of Parsoid's impl of and +#### tags. Parsoid's output for these tags differs from that of the +#### PHP parser. +#### ---------------------------------------------------------------- + +!!test +Ref: 1. ref-location should be replaced with an index span +!!options parsoid !! wikitext A foo @@ -20214,13 +20923,13 @@ B foo C !! html -

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

          -
            -
          1. ↑ foo
          2. -
          3. ↑ foo
          4. -
          5. ↑
          6. +

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

            +
              +
            1. ↑ foo
            2. +
            3. ↑ foo
            4. +
            5. ↑
            !!end @@ -20233,10 +20942,10 @@ A foo B !! html -

            A [1] -B [1]

            -
              -
            1. ↑ 1.0 1.1 foo
            2. +

              A [1] +B [1]

              +
                +
              1. 1 2 foo
              !!end @@ -20250,11 +20959,11 @@ B C !! html -

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

              -
                -
              1. ↑ 1.0 1.1 1.2 foo
              2. +

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

                +
                  +
                1. 1 2 3 foo
                !!end @@ -20267,9 +20976,9 @@ parsoid A foo !! html -

                A [1]

                -
                  -
                1. ↑ foo
                2. +

                  A [1]

                  +
                    +
                  1. ↑ foo
                  !!end @@ -20284,10 +20993,10 @@ A !! html -

                  A [1]

                  +

                  A [1]

                  -
                    -
                  1. ↑ This is a bolded link and this is a transclusion +
                      +
                    1. ↑ This is a bolded link and this is a transclusion
                    !!end @@ -20305,10 +21014,10 @@ A !! html -

                    A [1]

                    +

                    A [1]

                    -
                      -
                    1. ↑ foo +
                        +
                      1. ↑ foo bar baz
                      2. @@ -20335,10 +21044,10 @@ booz !! html -

                        A [1]

                        +

                        A [1]

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

                            A [1] B C}}

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

                              A [1] B C}}

                              +
                                +
                              1. ↑ foo {{echo|
                              !!end @@ -20375,9 +21084,9 @@ parsoid A foo +

                              A [1] B C

                              +
                                +
                              1. ↑ foo
                              !!end @@ -20390,11 +21099,11 @@ A foo B C !! html -

                              A [1] B C

                              +

                              A [1] B C

                              -
                                -
                              1. ↑ foo
                              2. +
                                  +
                                1. ↑ foo
                                !!end @@ -20407,37 +21116,35 @@ A foo B C bar D !! html -

                                A [1] B -C [2] D

                                -
                                  -
                                1. ↑ foo
                                2. -
                                3. ↑ bar
                                4. +

                                  A [1] B +C [2] D

                                  +
                                    +
                                  1. ↑ foo
                                  2. +
                                  3. ↑ bar
                                  !!end !!test Ref: 12. ref-tags act as trailing newline migration barrier -!!options -parsoid !! wikitext -a +a -b +b c -!! html -

                                  a

                                  +!! html/parsoid +

                                  a

                                  -

                                  b [1] -[2]

                                  +

                                  b [1] +[2]

                                  c

                                  -
                                    -
                                  1. ↑
                                  2. -
                                  3. ↑
                                  +
                                    +
                                  1. ↑
                                  2. +
                                  3. ↑
                                  !!end !!test @@ -20450,11 +21157,11 @@ parsoid
                                  B !! html -

                                  [1] A -[2] B

                                  -
                                    -
                                  1. ↑ foo
                                  2. -
                                  3. ↑ bar +

                                    [1] A +[2] B

                                    +
                                      +
                                    1. ↑ foo
                                    2. +
                                    3. ↑ bar
                                    !!end @@ -20468,10 +21175,10 @@ parsoid !! html -

                                    [1] +

                                    [1]

                                    -
                                      -
                                    1. ↑ foo <ref>bar</ref> baz
                                    2. +
                                        +
                                      1. ↑ foo <ref>bar</ref> baz
                                      !!end @@ -20485,10 +21192,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 2 foo
                                        2. 1 2 bar
                                        !!end @@ -20502,9 +21209,9 @@ A foo !! html -

                                        A [1]

                                        -
                                          -
                                        1. ↑ foo
                                        +

                                        A [1]

                                        +
                                          +
                                        1. ↑ foo
                                        !!end !!test @@ -20516,11 +21223,11 @@ parsoid !!html -

                                        [1] +

                                        [1]

                                        -
                                          -
                                        1. ↑ foo
                                        2. +
                                            +
                                          1. ↑ foo
                                          !!end @@ -20533,11 +21240,11 @@ parsoid !!html -

                                          [1] +

                                          [1]

                                          -
                                            -
                                          1. ↑ foo
                                          2. +
                                              +
                                            1. ↑ foo
                                            !!end @@ -20550,10 +21257,10 @@ parsoid !! html -

                                            1 [1] 2 [1] +

                                            1 [1] 2 [1]

                                            -
                                              -
                                            1. ↑ 1.0 1.1 foo
                                            2. +
                                                +
                                              1. 1 2 foo
                                              !!end @@ -20568,28 +21275,24 @@ C !! html -

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

                                              +

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

                                              -
                                              1. ↑ 1.0 1.1 1.2 Foo one
                                              2. +
                                                1. 1 2 3 Foo one
                                                !!end !!test References: 1. references tag without any refs should be handled properly -!!options -parsoid !! wikitext -!! html -
                                                  +!! html/parsoid +
                                                    !!end !!test References: 2. references tag with group only outputs references from that group -!!options -parsoid !! wikitext A foo B bar @@ -20598,26 +21301,24 @@ C baz -!! html -

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

                                                    +!! html/parsoid +

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

                                                    -
                                                      -
                                                    1. ↑ foo
                                                    2. +
                                                        +
                                                      1. ↑ foo
                                                      -
                                                        -
                                                      1. ↑ baz
                                                      2. +
                                                          +
                                                        1. ↑ baz
                                                        -
                                                          -
                                                        1. ↑ bar
                                                        2. +
                                                            +
                                                          1. ↑ bar
                                                          !!end !!test References: 3. ref list should be cleared after processing references -!!options -parsoid !! wikitext A foo @@ -20626,23 +21327,21 @@ A foo B bar -!! html -

                                                          A [1]

                                                          +!! html/parsoid +

                                                          A [1]

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

                                                            B [1]

                                                            +

                                                            B [1]

                                                            -
                                                              -
                                                            1. ↑ bar
                                                            2. +
                                                                +
                                                              1. ↑ bar
                                                              !!end !!test References: 4. only referenced group should be cleared after processing references -!!options -parsoid !! wikitext A afoo B bfoo @@ -20652,23 +21351,21 @@ B bfoo C cfoo -!! html -

                                                              A [a 1] -B [1]

                                                              +!! html/parsoid +

                                                              A [a 1] +B [1]

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

                                                                C [2]

                                                                +

                                                                C [2]

                                                                -
                                                                1. ↑ bfoo
                                                                2. ↑ cfoo
                                                                3. +
                                                                  1. ↑ bfoo
                                                                  2. ↑ cfoo
                                                                  !!end !!test References: 5. ref tags in references should be processed while ignoring all other content -!!options -parsoid !! wikitext A B bar @@ -20677,30 +21374,26 @@ B bar foo This should just get lost. -!! html -

                                                                  A [1] -B [2]

                                                                  +!! html/parsoid +

                                                                  A [1] +B [2]

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

                                                                    [1]

                                                                    1. ↑ Foo
                                                                    2. +!! html/parsoid +

                                                                      [1]

                                                                      1. ↑ Foo
                                                                      !!end !! test References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled -!! options -parsoid !! wikitext A foo bar for a B @@ -20710,30 +21403,28 @@ B foo -!! html -

                                                                      A [1] -B [X 1] +!! html/parsoid +

                                                                      A [1] +B [X 1]

                                                                      -
                                                                        -
                                                                      1. ↑ foo bar for a
                                                                      2. +
                                                                          +
                                                                        1. ↑ foo bar for a
                                                                        -
                                                                          -
                                                                        1. ↑ foo
                                                                        2. +
                                                                            +
                                                                          1. ↑ foo
                                                                          !! end !! test References: 8. T88019: Remove s from templates inside that's itself inside a template -!! options -parsoid !! wikitext X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}} -!! html -

                                                                          X[1]

                                                                          -
                                                                          1. ↑ foo bar and baz boo
                                                                          2. +!! html/parsoid +

                                                                            X[1]

                                                                            +
                                                                            1. ↑ foo bar and baz boo
                                                                            !!end @@ -20743,18 +21434,16 @@ X{{echo|foo {{echo|bar}} and {{echo|baz}} boo}} # wt2wt. !! test References: 9. Generate missing references list at the end -!! options -parsoid !! wikitext A foo B bar -!! html -

                                                                            A [1] B [inexistent 1]

                                                                            -
                                                                              -
                                                                            1. ↑ foo
                                                                            2. +!! html/parsoid +

                                                                              A [1] B [inexistent 1]

                                                                              +
                                                                                +
                                                                              1. ↑ foo
                                                                              -
                                                                                -
                                                                              1. ↑ bar
                                                                              2. +
                                                                                  +
                                                                                1. ↑ bar
                                                                                !! end @@ -20776,15 +21465,13 @@ A foo !! test Entities in ref name -!! options -parsoid !! wikitext hi -!! html -

                                                                                [1]

                                                                                -
                                                                                  -
                                                                                1. ↑ hi
                                                                                2. +!! html/parsoid +

                                                                                  [1]

                                                                                  +
                                                                                    +
                                                                                  1. ↑ hi
                                                                                  !! end @@ -20798,10 +21485,10 @@ parsoid=wt2html afoo -!! html -

                                                                                  a[1]

                                                                                  -
                                                                                    -
                                                                                  1. ↑ foo
                                                                                  +!! html/parsoid +

                                                                                  a[1]

                                                                                  +
                                                                                    +
                                                                                  1. ↑ foo
                                                                                  !! end !! test @@ -20811,8 +21498,8 @@ parsoid=wt2wt,html2wt !! wikitext foo -!! html -foo
                                                                                    +!! html/parsoid +foo
                                                                                      !! end #### ---------------------------------------------------------------- @@ -21045,8 +21732,6 @@ parsoid=html2wt !! test Headings: 5. Empty headings -!! options -parsoid !! wikitext == @@ -21059,19 +21744,22 @@ parsoid ========== ============ -!! html -

                                                                                      -

                                                                                      -

                                                                                      -

                                                                                      -
                                                                                      -
                                                                                      +!! html/parsoid +

                                                                                      + +

                                                                                      + +

                                                                                      + +

                                                                                      + +
                                                                                      + +
                                                                                      !!end !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) -!! options -parsoid !! wikitext =a= @@ -21080,17 +21768,24 @@ parsoid =a= =a= -!! html -

                                                                                      =a=

                                                                                      -

                                                                                      =a=

                                                                                      -

                                                                                      =a=

                                                                                      -

                                                                                      =a=

                                                                                      +!! html/php +

                                                                                      =a= +

                                                                                      =a= +

                                                                                      =a= +

                                                                                      =a= +

                                                                                      +!! html/parsoid +

                                                                                      =a=

                                                                                      + +

                                                                                      =a=

                                                                                      + +

                                                                                      =a=

                                                                                      + +

                                                                                      =a=

                                                                                      !!end !! test Headings: 6b. Heading chars in SOL context (with trailing newlines) -!! options -parsoid !! wikitext =a= b @@ -21103,48 +21798,65 @@ b
                                                                                      =a= b -!! html +!! html/php

                                                                                      =a= -b

                                                                                      -

                                                                                      =a= -b

                                                                                      -

                                                                                      =a= -b

                                                                                      -

                                                                                      =a= -b

                                                                                      +b +

                                                                                      =a= +b +

                                                                                      =a= +b +

                                                                                      =a= +b

                                                                                      +!! html/parsoid +

                                                                                      =a= +b

                                                                                      + +

                                                                                      =a= +b

                                                                                      + +

                                                                                      =a= +b

                                                                                      + +

                                                                                      =a= +b

                                                                                      !!end !! test Headings: 6c. Heading chars in SOL context (leading newline break) -!! options -parsoid !! wikitext a =b= -!! html +!! html/php

                                                                                      a -=b=

                                                                                      +=b= +

                                                                                      +!! html/parsoid +

                                                                                      a +=b= !!end !! test Headings: 6d. Heading chars in SOL context (with interspersed comments) -!! options -parsoid !! wikitext =a= =a= -!! html -

                                                                                      =a=

                                                                                      -

                                                                                      =a=

                                                                                      +!! html/php +

                                                                                      =a= +

                                                                                      =a= +

                                                                                      +!! html/parsoid +

                                                                                      =a=

                                                                                      + +

                                                                                      =a=

                                                                                      !!end !! test Headings: 6d. Heading chars in SOL context (No escaping needed) !! options parsoid=html2wt -!! html +!! html/parsoid =a=
                                                                                      b
                                                                                      !! wikitext =a=
                                                                                      b
                                                                                      @@ -21154,11 +21866,11 @@ parsoid=html2wt Headings: 7. Insert a newline between new content and headings !! options parsoid=html2wt -!! html +!! html/parsoid

                                                                                      NEW

                                                                                      new

                                                                                      -

                                                                                      A

                                                                                      -

                                                                                      a

                                                                                      +

                                                                                      A

                                                                                      +

                                                                                      a

                                                                                      !! wikitext == NEW == new @@ -21187,11 +21899,17 @@ Lists: 0. Outside nests #foo ;Foo:bar -!! html +!! html/php

                                                                                      *foo

                                                                                      #foo

                                                                                      ;Foo:bar

                                                                                      +!! html/parsoid +

                                                                                      *foo

                                                                                      + +

                                                                                      #foo

                                                                                      + +

                                                                                      ;Foo:bar

                                                                                      !!end !! test @@ -21711,6 +22429,40 @@ parsoid=wt2html !! end +!! test +T97430: Don't emit empty nowiki pairs around marker meta tags +!! options +parsoid=html2wt +!! html +

                                                                                      *This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs +|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.

                                                                                      +!! wikitext +*This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs +|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis. +!! end + +!! test +Unclosed xmlish element in table line shouldn't eat end delimiters +!! wikitext +{| +| +|} +!! html/php + + + +
                                                                                      <foo + bar> +
                                                                                      + +!! html/parsoid + + + +
                                                                                      <foo bar>
                                                                                      +!! end + #### --------------- Links ---------------- #### 1. Quote marks in link text #### 2. Wikilinks: Escapes needed @@ -22086,10 +22838,10 @@ parsoid=html2wt,wt2wt a' foo bar a' foo bar foo x'bar -'foo [1] +'foo [1] 'foo
                                                                                      test
                                                                                      'foo and
                                                                                      bar -
                                                                                        +
                                                                                        1. ↑ test
                                                                                        !! end @@ -22207,9 +22959,9 @@ foo ''a'' b !! html -

                                                                                        foo [1]

                                                                                        -
                                                                                          -
                                                                                        1. ↑ a +

                                                                                          foo [1]

                                                                                          +
                                                                                            +
                                                                                          1. ↑ a b
                                                                                          !! end @@ -22240,7 +22992,7 @@ parsoid !! wikitext [[File:Foobar.jpg|thumb|caption]] !! html/parsoid -
                                                                                          caption
                                                                                          +
                                                                                          caption
                                                                                          !! end !! test @@ -22253,7 +23005,22 @@ parsoid=html2wt ==foo== !! end +!!test +T95794: nowiki escaping should account for leading space at start-of-line in an indent-pre block +!! options +parsoid +!! wikitext + * foo + * bar +!! html +
                                                                                          +* foo
                                                                                          +* bar
                                                                                          +
                                                                                          +!! end + #### --------------- Behavior Switches -------------------- + !! test 1. Valid behavior switches should be escaped !! options @@ -22278,6 +23045,29 @@ __TOO__ __|__ !! end +# We use indent-pre as an indirect way to test for sol-transparent behavior. +!! test +Behavior switches should be SOL-transparent +!! wikitext + __TOC__ + + + __TOO__ + + __TOC__ foo + +__TOC__ bar +!! html/parsoid + + + +
                                                                                          __TOO__
                                                                                          + +
                                                                                           foo
                                                                                          + +
                                                                                          bar
                                                                                          +!! end + #### --------------- HTML tags --------------- #### 1. a tags #### 2. other tags @@ -22599,6 +23389,8 @@ bar !!end +# Note that the "style" attribute is really a template parameter here. +# The = would have to be {{=}} if you wanted the literal. !!test Empty TD followed by TD with tpl-generated attribute !! wikitext @@ -22759,7 +23551,7 @@ 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 +!! html/parsoid

                                                                                          new para

                                                                                          new heading

                                                                                          @@ -22776,12 +23568,10 @@ new para ## a Parsoid serializer test, marking this Parsoid only !!test Improperly nested inline or quotes tags with whitespace in between -!!options -parsoid !! wikitext x ''' ''x''' '' -!! html +!! html/parsoid

                                                                                          x x

                                                                                          @@ -22789,12 +23579,10 @@ parsoid !!test Encapsulate protected attributes from wt -!!options -parsoid !! wikitext -
                                                                                          foo
                                                                                          -!! html -
                                                                                          foo
                                                                                          +
                                                                                          foo
                                                                                          +!! html/parsoid +
                                                                                          foo
                                                                                          !!end @@ -22807,7 +23595,7 @@ Ensure ParagraphWrapper can deal with stray closing pre tags parsoid=wt2html !! wikitext plain text
                  -!! html +!! html/parsoid plain text !!end @@ -22817,7 +23605,7 @@ plain text parsoid=wt2html !! wikitext hi
                  ho
                  -!! html +!! html/parsoid

                  hi

                  ho

                  @@ -22833,7 +23621,7 @@ parsoid=wt2html,wt2wt || || a -!! html +!! html/parsoid

                  || ||

                  @@ -22846,7 +23634,7 @@ Encapsulation properly handles null DSR information from foster box parsoid=wt2html,wt2wt !! wikitext {{echo|
                  a
                  foo
                  bar
                  }} -!! html +!! html/parsoid foo
                  bar
                  !!end @@ -22856,7 +23644,7 @@ parsoid=wt2html,wt2wt parsoid=wt2wt,wt2html !! wikitext {{echo|foo}}
                  bar
                  -!! html +!! html/parsoid

                  foo

                  @@ -22872,7 +23660,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
                  {{echo|foo}}
                  bar
                  -!! html +!! html/parsoid
                  foo
                  @@ -22889,7 +23677,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext

                  {{echo|foo

                  }}bar
                  -!! html +!! html/parsoid

                  foo

                  @@ -22908,7 +23696,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext

                  {{echo|foo

                  }}bar
                  -!! html +!! html/parsoid

                  foo

                  @@ -22927,7 +23715,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext foo}}

                  {{echo|foo

                  -!! html +!! html/parsoid

                  foo

                  @@ -22948,7 +23736,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
                  foo

                  {{echo|foo

                  }}

                  ok

                  -!! html +!! html/parsoid

                  foo

                  @@ -22970,7 +23758,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
                  {{echo|

                  foo

                  }}
                  bar
                  -!! html +!! html/parsoid

                  foo

                  @@ -22981,6 +23769,8 @@ parsoid=wt2wt,wt2html
                  !!end +# Note that the wt is broken on purpose: the = should be {{=}} if you +# don't want it to be a template parameter key. !!test 8. Encapsulate foster-parented transclusion content !!options @@ -22991,8 +23781,11 @@ parsoid=wt2wt,wt2html |- |b |} -!! html -

                  a

                  {{{1}}}

                  +!! html/parsoid +

                  a

                  + +

                  {{{1}}}

                  +
                  @@ -23007,7 +23800,7 @@ parsoid=wt2wt,wt2html parsoid=wt2wt,wt2html !! wikitext
                  b
                  {{echo|hi
                  hello}} -!! html +!! html/parsoid

                  hi

                  hello

                  !!end @@ -23022,7 +23815,7 @@ parsoid=wt2html,wt2wt |}
                  |} -!! html +!! html/parsoid
                  @@ -23050,7 +23843,7 @@ Properly encapsulate empty-content transclusions in fosterable positions Support element with .data attribute !!options parsoid=html2wt -!! html +!! html/parsoid !! wikitext @@ -23327,7 +24120,7 @@ Image: Block level image should have \n before and after 456 !! html/parsoid

                  123

                  -
                  +

                  456

                  !!end @@ -23345,26 +24138,22 @@ Image: New block level image should have \n before and after (existing content) !! test Image: upright option (parsoid) -!! options -parsoid !! wikitext [[File:Foobar.jpg|thumb|upright|caption]] [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] -!! html -
                  caption
                  -
                  caption
                  -
                  caption
                  +!! html/parsoid +
                  caption
                  +
                  caption
                  +
                  caption
                  !!end !! test Image: upright option is ignored on inline and frame images (parsoid) -!! options -parsoid !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] -!! html -

                  +!! html/parsoid +

                  !!end !! test @@ -23496,22 +24285,6 @@ foo !! end -!! test -Lists: Add space after bullets -!! options -parsoid=html2wt -!! html -
                    -
                  • foo
                  • -
                  • bar
                  • -
                  • baz
                  • -
                  -!! wikitext -* foo -* bar -* baz -!! end - !! test Lists: Dont insert newlines in a serialized list item. !! options @@ -23524,42 +24297,103 @@ parsoid=html2wt !! end !! test -Headings: Add space before/after == (Bug 51744) +1. Headings: Force sol-transparent links and behavior switches to serialize before/after !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} !! html -

                  foo

                  -

                  bar

                  -

                  baz

                  -

                  baz

                  -!! wikitext -== foo == +

                  hello there

                  +

                  hi pal

                  -== bar == +

                  how goes it

                  +

                  it goes well

                  -== baz == +

                  howdy

                  -== baz == +

                  ok

                  +!! wikitext +== hello there [[Category:A1]] == + +== [[Category:A2]] hi pal == + +== [[Category:A3]] how goes it == + +== it goes well [[Category:A4]] == + +==howdy [[Category:A5]] == + +== __TOC__ ok == !! end !! test -Headings: Force metas to serialize before/after +2. Headings: Force sol-transparent links and behavior switches to serialize before/after !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} !! html

                  hello there

                  hi pal

                  how goes it

                  +

                  it goes well

                  + +

                  howdy

                  + +

                  ok

                  !! wikitext == hello there == [[Category:A1]] - [[Category:A2]] + == hi pal == [[Category:A3]] + == how goes it == + +== it goes well == +[[Category:A4]] + +==howdy [[Category:A5]] == + +__TOC__ + +== ok == +!! end + +!! test +Headings: Don't hoist metas that come from templates +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  foo

                  +!! wikitext +== {{echo|foo [[Category:Foo]]}} == +!! end + +!! test +Headings: Category in ref isn't hoisted +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  foo [1]

                  + +
                  1. ↑ bar
                  +!! wikitext +== foo bar +[[Category:Baz]] == + + !! end !! test @@ -23639,17 +24473,79 @@ parsoid=html2wt

                  testing 123

                  +

                  hi there +you

                  + +

                  foo [1]

                  + +
                  1. ↑ hello +there
                  +
                  • asd sdf
                  + +
                  • foo +bar +baz
                  • +
                  • foo bar +baz
                  + +
                  hi +ho
                  hi +ho
                  + +
                  + +
                  ha +ha +ha
                  !! wikitext == testing 123 == +== hi {{bogus|there +you}} == + +== foo hello +there == + + + * asd sdf + +* foo bar baz +* foo '''bar''' baz + +; hi ho : hi ho + +: {| +| ha +ha +ha +|} !! end -#----------------------------- -# I/B quote minimization tests -#----------------------------- +!! test +Serialize new placeholder space without spans +!! options +parsoid=html2wt +!! html +

                  foo : bar

                  + +

                  foo : bar

                  + +[1]ok

                  +!! wikitext +foo : bar + +foo : bar + +foo : barok +!! end + + +#----------------------- +# Tag minimization tests +#----------------------- !! test 1. I/B quote minimization: wikitext-only tags should be combined @@ -23754,9 +24650,52 @@ parsoid={ ''ac'' !! end -#------------------------------------ -# End of I/B quote minimization tests -#------------------------------------ +!! test +1. Merge adjacent link nodes as long as at least one element is new +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +Football +Football +Football +!! wikitext +[[Football]] +[[Football]] +[[Football|Foot]][[Football|ball]] +!! end + +!! test +2. Merge adjacent link nodes and enable additional normalizations +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +Football +!! wikitext +[[Football|''Football'']] +!! end + +!! test +3. Don't merge adjacent link nodes if scrubWikitext is false +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html +Football +!! wikitext +[[Football|Foot]][[Football|ball]] +!! end + +#------------------------------ +# End of tag minimization tests +#------------------------------ !!test Bug 54262: New entities @@ -23775,7 +24714,7 @@ parsoid=html2wt Magic words !! options parsoid=html2wt -!! html +!! html/parsoid @@ -23910,6 +24849,31 @@ xhttp://cscott.netx xhttp://cscott.netx !! end +!! test +WTS of edited autolink-like text (T103364) +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "span[typeof]", "removeAttr", "typeof" ] + ] +} +!! wikitext +Not a link: http://example.com. +!! wikitext/edited +Not a link: http://example.com. +!! end + +!! test +WTS of newly-authored autolink-like text (T103364) +!! options +parsoid=html2wt +!! html/parsoid +

                  http://example.com is not a link.

                  +!! wikitext +http://example.com is not a link. +!! end + !! test Edited Redirect link should emit a non-piped wikitext link !! options @@ -24033,6 +24997,252 @@ parsoid=html2wt [[Foo]] !! end +## SSS FIXME: This is broken output nevertheless. +## What might be a reasonable non-broken output for this? +## This is an edge case unlikely to be seen in production +## that I am not wasting more time on this right now. +!! test +Never serialize a-tag as html, no matter what attributes it has +!! options +parsoid=html2wt +!! html + +!! wikitext +[http://boo.org http://boohoo.org] +!! end + +# -------------------------------------------- +# Tests spec'ing wikitext serialization norms | +# -------------------------------------------- + +!! test +Lists: Add space after bullets +!! options +parsoid=html2wt +!! html +
                    +
                  • foo
                  • +
                  • bar
                  • +
                  • baz
                  • +
                  +!! wikitext +* foo +* bar +* baz +!! end + +!! test +1. Headings: Add space before/after == (T53744) +!! options +parsoid=html2wt +!! html +

                  foo

                  +

                  bar

                  +

                  baz

                  +

                  baz

                  +!! wikitext +== foo == + +== bar == + +== baz == + +== baz == +!! end + +!! test +2. Headings: Add space before/after == even after hoisted content +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  ok

                  +!! wikitext + [[Category:A2]] + +== ok == +!! end + +!! test +1. Headings: suppress newly created empty headings +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  +!! wikitext +!! end + +!! test +2. Headings: don't suppress empty headings if scrubWikitext is false +!! options +parsoid=html2wt +!! html +

                  +!! wikitext +==== +!! end + +!! test +3. Headings: don't suppress empty headings for existing headings even if scrubWikitext is true +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  +!! wikitext +==== +!! end + +!! test +1. WT Quote Tags: suppress newly created empty style tags +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html + +!! wikitext +!! end + +!! test +2. WT Quote Tags: don't suppress empty style tags if scrubWikitext is false +!! options +parsoid=html2wt +!! html + +!! wikitext +'''''''''' +!! end + +!! test +1. Indent Pre Nowiki: suppress whitespace at the start of new paragraph +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  hi

                  +

                  hello

                  +!! wikitext +hi + +hello +!! end + +!! test +2. Indent Pre Nowiki: don't suppress whitespace at the start of new paragraph if scrubWikitext is false +!! options +parsoid=html2wt +!! html +

                  hi

                  +

                  hello

                  +!! wikitext + hi + + hello +!! end + +!! test +3. Indent Pre Nowiki: suppress whitespace after newlines in new paragraph or table cell +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html/parsoid +

                  Foo + bar +baz

                  + +
                  Foo + bar + baz bang
                  + +

                  foo + bar

                  + +

                  foo + barboo

                  +!! wikitext +Foo +bar +baz + +{| +|Foo +bar +baz bang +|} + +foo +bar + +foo +barboo +!! end + +!! test +1. New links that end in spaces +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! html +

                  Berlin is the capital of Germany.

                  +

                  Foo bar

                  +!! wikitext +[[Berlin ]]is the capital of Germany. + +[[Foo ]]'''bar''' +!! end + +!! test +2. New links that end in spaces +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  Berlin is the capital of Germany.

                  +

                  Foo bar

                  +!! wikitext +[[Berlin]] is the capital of Germany. + +[[Foo]] '''bar''' +!! end + +!! test +3. Existing links that end in spaces +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} +!! html +

                  Berlin is the capital of Germany.

                  + +

                  Foo bar

                  +!! wikitext +[[Berlin ]]is the capital of Germany. + +[[Foo ]]'''bar''' +!! end + +# --------------------------------------------------- +# End of tests spec'ing wikitext serialization norms | +# --------------------------------------------------- + # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content @@ -24048,7 +25258,7 @@ parsoid=html2wt ## T90517 !! test -1. Selser: New comments should not be lost +Selser: New comments should not be lost !! options parsoid={ "modes": ["selser"], @@ -24069,7 +25279,7 @@ parsoid={ ## T89383 !! test -2. Selser: Check for validity of DSR before using it +Selser: Check for validity of DSR before using it !! options parsoid={ "modes": ["selser"], @@ -24084,10 +25294,55 @@ parsoid={ a !! end +!! test +1. DOMDiff: Changes to content should be looked up using id +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + ["#X", "after", "bar"], + ["#Y", "after", "baz"] + ] +} +!! wikitext +X foo +Y + +foo + +!! wikitext/edited +X foobar +Y + +foobaz + +!! end -TODO: -more images -more tables -character entities -and much more -Try for 100% code coverage +!! test +2. DOMDiff: Changes to content should be looked up using id +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + ["#Z", "after", "bar"] + ] +} +!! wikitext +A foo bar for a +B + + + + +foo + +!! wikitext/edited +A foo bar for a +B + + + + +foobar + +!! end