From eade3aedf59b8263849d07d4d2f99d237a4c93f4 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 4 Aug 2015 12:30:20 -0400 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 19c5d8af12ea0a79141f3aa0634d0fd28fb30c5c Change-Id: Ifffc18a38c6501706209d1b033d2305a7534ba61 --- tests/parser/parserTests.txt | 679 ++++++++++++++++++++++++++--------- 1 file changed, 513 insertions(+), 166 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9226d4ce0b..b9ff013625 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -160,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 @@ -1314,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 (
@@ -1325,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 @@ -1363,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 @@ -1378,7 +1400,7 @@ sed abit. :and a colon
-!! html +!! html/php

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

+!! html/parsoid +

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

!! end !! test @@ -1400,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. @@ -1408,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 @@ -1436,7 +1475,7 @@ parsoid=html2wt !! html

    * </nowiki> tag

    !! wikitext -* </nowiki> tag +* </nowiki> tag !! end !! test @@ -2223,7 +2262,7 @@ Entities inside
     
     
    -!! html +!! html/php
     <nowiki>
     
    @@ -2236,6 +2275,18 @@ Entities inside
     
     </pre>
     

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

    </nowiki> +</pre>

    + +

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

    !! end !! test @@ -3397,7 +3448,7 @@ HTML-pre: 3: other wikitext '' no-italic '' [[ NoLink ]]
    -!! html +!! html/php
     * foo
     # bar
    @@ -3406,6 +3457,13 @@ HTML-pre: 3: other wikitext
     [[ NoLink ]]
     
    +!! html/parsoid +
    * foo
    +# bar
    += no-h =
    +'' no-italic ''
    +[[ NoLink ]]
    +
    !!end ### @@ -4236,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 @@ -6163,6 +6232,21 @@ Indented table markup mixed with indented pre content (proposed in bug 6200) !! 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 @@ -9632,6 +9716,15 @@ __NOEDITSECTION__ !! end +!!test +__proto__ is treated as normal wikitext (T105997) +!!wikitext +__proto__ +!!html +

    __proto__ +

    +!!end + ### ### Magic links ### @@ -10216,7 +10309,7 @@ File:Foobar.jpg msgnw keyword !! wikitext {{msgnw:MSGNW test}} -!! html +!! html/php

    ''None'' of '''this''' should be * interpreted but rather passed unmodified @@ -11004,6 +11097,25 @@ Templates: Support for templates generating attributes and content !! 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 @@ -11468,41 +11580,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 @@ -11513,7 +11624,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 @@ -11529,11 +11640,10 @@ pre-save transform: nowiki in subst (bug 1188) pst !! wikitext {{subst:nowikitest}} -!! html +!! html/php '''not wiki''' !! end - !! article Template:commenttest !! text @@ -11546,7 +11656,7 @@ pre-save transform: comment in subst (bug 1936) pst !! wikitext {{subst:commenttest}} -!! html +!! html/php This template has in it. !! end @@ -11556,7 +11666,7 @@ pre-save transform: unclosed tag pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11566,7 +11676,7 @@ pre-save transform: mixed tag case pst noxml !! wikitext '''not wiki''' -!! html +!! html/php '''not wiki''' !! end @@ -11576,7 +11686,7 @@ pre-save transform: unclosed comment in pst noxml !! wikitext wikinowiki -!! html +!! html/php !!end @@ -11614,7 +11724,7 @@ pre-save transform: comment containing extension pst !! wikitext -!! html +!! html/php !!end @@ -11624,7 +11734,7 @@ pre-save transform: comment containing nowiki pst !! wikitext -!! html +!! html/php !!end @@ -11634,7 +11744,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes}} -!! html +!! html/php Foobar !! end @@ -11644,7 +11754,7 @@ pre-save transform: in subst (bug 3298) pst !! wikitext {{subst:Includes2}} -!! html +!! html/php Foo !! end @@ -11666,7 +11776,7 @@ bug 22297: safesubst: works during PST pst !! wikitext {{subst:SafeSubstTest}}{{safesubst:SubstTest}} -!! html +!! html/php FoobarFoobar !! end @@ -11702,7 +11812,7 @@ pst [[|Article (context)]] [[Bar:X (Y) Z|]] [[:Bar:X (Y) Z|]] -!! html +!! html/php [[Article (context)|Article]] [[Bar:Article|Article]] [[:Bar:Article|Article]] @@ -11723,7 +11833,7 @@ pst [[:interwiki:Article|]] [[interwiki:Bar:Article|]] [[:interwiki:Bar:Article|]] -!! html +!! html/php [[interwiki:Article|Article]] [[:interwiki:Article|Article]] [[interwiki:Bar:Article|Bar:Article]] @@ -11736,7 +11846,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 @@ -11748,7 +11858,7 @@ pst title=[[Someplace, Somewhere]] [[|Otherplace]] [[Otherplace, Elsewhere|]] [[Otherplace, Elsewhere, Anywhere|]] -!! html +!! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace, Elsewhere|Otherplace]] [[Otherplace, Elsewhere, Anywhere|Otherplace]] @@ -11761,7 +11871,7 @@ pst title=[[Someplace (IGNORED), Somewhere]] !! wikitext [[|Otherplace]] [[Otherplace (place), Elsewhere|]] -!! html +!! html/php [[Otherplace, Somewhere|Otherplace]] [[Otherplace (place), Elsewhere|Otherplace]] !! end @@ -11773,7 +11883,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 @@ -11784,7 +11894,7 @@ pre-save transform: context links ("pipe trick") with namespace pst title=[[Ns:Somearticle]] !! wikitext [[|Article]] -!! html +!! html/php [[Ns:Article|Article]] !! end @@ -11794,7 +11904,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 @@ -11804,7 +11914,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 @@ -11814,7 +11924,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 @@ -11824,7 +11934,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 @@ -11839,7 +11949,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]] @@ -11859,7 +11969,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]] @@ -11879,7 +11989,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]] @@ -11899,7 +12009,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]] @@ -11918,7 +12028,7 @@ Empty lines are trimmed -!! html +!! html/php Empty lines are trimmed !! end @@ -11931,7 +12041,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]] @@ -11962,7 +12072,7 @@ As well as inside noinclude/onlyinclude But not inside includeonly {{subst:Foo}} -!! html +!! html/php Shall not expand: ~~~~ @@ -15612,7 +15722,7 @@ evil -wiki-tags without Extension:Math enabled Parser hook: empty input !! wikitext -!! html +!! html/php

     ''
     array (
    @@ -15625,7 +15735,7 @@ array (
     Parser hook: empty input using terminated empty elements
     !! wikitext
     
    -!! html
    +!! html/php
     
     NULL
     array (
    @@ -15638,7 +15748,7 @@ array (
     Parser hook: empty input using terminated empty elements (space before)
     !! wikitext
     
    -!! html
    +!! html/php
     
     NULL
     array (
    @@ -15651,7 +15761,7 @@ array (
     Parser hook: basic input
     !! wikitext
     input
    -!! html
    +!! html/php
     
     'input'
     array (
    @@ -15665,7 +15775,7 @@ array (
     Parser hook: case insensitive
     !! wikitext
     input
    -!! html
    +!! html/php
     
     'input'
     array (
    @@ -15679,7 +15789,7 @@ array (
     Parser hook: case insensitive, redux
     !! wikitext
     input
    -!! html
    +!! html/php
     
     'input'
     array (
    @@ -15694,7 +15804,7 @@ Parser hook: nested tags
     noxml
     !! wikitext
     
    -!! html
    +!! html/php
     
     ''
     array (
    @@ -15707,7 +15817,7 @@ array (
     Parser hook: basic arguments
     !! wikitext
     
    -!! html
    +!! html/php
     
     ''
     array (
    @@ -15724,7 +15834,7 @@ array (
     Parser hook: argument containing a forward slash (bug 5344)
     !! wikitext
     
    -!! html
    +!! html/php
     
     ''
     array (
    @@ -15738,7 +15848,7 @@ array (
     Parser hook: empty input using terminated empty elements (bug 2374)
     !! wikitext
     text
    -!! html
    +!! html/php
     
     NULL
     array (
    @@ -15755,7 +15865,7 @@ Parser hook: basic arguments using terminated empty elements (bug 2374)
     
     other stuff
     
    -!! html
    +!! html/php
     
     NULL
     array (
    @@ -15779,7 +15889,7 @@ Parser hook: static parser hook not inside a comment
     !! wikitext
     hello, world
     
    -!! html
    +!! html/php
     

    hello, world

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


    !! end @@ -15849,20 +15959,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 -!! html -

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

    +!! html/php+tidy +

    Table not started

    +!! html/parsoid +

    Table not started

    !! end !! test @@ -16661,7 +16775,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start !! end @@ -16681,7 +16795,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==a== ===aa=== ====aaa==== @@ -16703,7 +16817,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===aa=== ====aaa==== !! end @@ -16724,7 +16838,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ====aaa==== !! end @@ -16744,7 +16858,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==b== ===ba=== ===bb=== @@ -16768,7 +16882,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===ba=== !! end @@ -16788,7 +16902,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===bb=== ====bba==== !! end @@ -16809,7 +16923,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ====bba==== !! end @@ -16829,7 +16943,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===bc=== !! end @@ -16849,7 +16963,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ==c== ===ca=== !! end @@ -16870,7 +16984,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php ===ca=== !! end @@ -16890,7 +17004,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php !! end !! test @@ -16901,7 +17015,7 @@ section=1 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==a== ==bogus== not a legal section !! end @@ -16914,7 +17028,7 @@ section=2 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==b== !! end @@ -16926,7 +17040,7 @@ section=1 ==a== ==b== ==c== -!! html +!! html/php ==a== !! end @@ -16938,7 +17052,7 @@ section=2 ==a== ==b== ==c== -!! html +!! html/php ==b== !! end @@ -16950,7 +17064,7 @@ section=1 ==a== ==bogus== not a legal section ==b== -!! html +!! html/php ==a== ==bogus== not a legal section !! end @@ -16963,11 +17077,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 @@ -16977,7 +17090,7 @@ section=1 !! wikitext ==sec1== ==sec2== -!! html +!! html/php ==sec2== !!end @@ -16988,11 +17101,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 @@ -17006,7 +17118,7 @@ unmarked one ==2== two -!! html +!! html/php ==1== one !! end @@ -17022,7 +17134,7 @@ unmarked one ==2== two -!! html +!! html/php ==2== two !! end @@ -17036,7 +17148,7 @@ section=1 !! wikitext ==unmarked== ==marked== -!! html +!! html/php ==marked== !!end @@ -17051,7 +17163,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... @@ -17073,7 +17185,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php xxx ==a== @@ -17104,7 +17216,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start xxx @@ -17133,7 +17245,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== xxx @@ -17163,7 +17275,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17194,7 +17306,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17221,7 +17333,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17252,7 +17364,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17282,7 +17394,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17313,7 +17425,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17344,7 +17456,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17373,7 +17485,7 @@ start ===bc=== ==c== ===ca=== -!! html +!! html/php start ==a== ===aa=== @@ -17395,7 +17507,7 @@ replace=2,"xxx" Preformatted initial line ==a== ===a=== -!! html +!! html/php Preformatted initial line ==a== xxx @@ -17409,7 +17521,7 @@ section=1 !! wikitext ==a== a -!! html +!! html/php ==a== a !! end @@ -17421,7 +17533,7 @@ section=1 !! wikitext ==a== a -!! html +!! html/php ==a== a !! end @@ -17439,7 +17551,7 @@ noxml section=2 == Section Two == stuff -!! html +!! html/php == Section Two == stuff !! end @@ -17456,7 +17568,7 @@ noxml replace=2,"xxx" == Section Two == stuff -!! html +!! html/php == Section One ==
     =======
    @@ -17466,7 +17578,6 @@ xxx
     !! end
     
     
    -
     !! test
     Handling of 
     in URLs
     !! wikitext
    @@ -18253,7 +18364,7 @@ Don't fall for the self-closing div
     MSGNW magic word
     !! wikitext
     {{MSGNW:msg}}
    -!! html
    +!! html/php
     

    [[:Template:Msg]]

    !! end @@ -19686,7 +19797,7 @@ wgAllowDisplayTitle=true wgRestrictDisplayTitle=false !! wikitext this is not the the title -!! html +!! html/php Parser test

    this is not the the title

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

    this is not the the title

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

    this is not the the title

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

    this is not the the title

    @@ -19753,7 +19864,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 @@ -19769,7 +19880,7 @@ title=[[Screen]] wgAllowDisplayTitle=false !! wikitext this is not the the title -!! html +!! html/php Screen

    this is not the the title

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

    this is not the the title

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

    this is not the the title

    @@ -19891,7 +20002,7 @@ preload: check and preload !! wikitext Hello cruelkind world. -!! html +!! html/php Hello kind world. !! end @@ -19901,7 +20012,7 @@ preload: check preload !! wikitext Goodbye Hello world -!! html +!! html/php Hello world !! end @@ -19911,7 +20022,7 @@ preload: can pass tags through if we want to preload !! wikitext <includeonly>Hello world</includeonly> -!! html +!! html/php Hello world !! end @@ -19921,7 +20032,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 @@ -20753,6 +20864,30 @@ parsoid=wt2html,wt2wt
    !! end +!! 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 @@ -21606,8 +21741,6 @@ Headings: 5. Empty headings !! test Headings: 6a. Heading chars in SOL context (with trailing spaces) -!! options -parsoid !! wikitext =a= @@ -21616,17 +21749,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 @@ -21639,48 +21779,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= +

    +!! html/parsoid

    a -=b=

    +=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
    @@ -21690,11 +21847,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 @@ -21723,11 +21880,17 @@ Lists: 0. Outside nests #foo ;Foo:bar -!! html +!! html/php

    *foo

    #foo

    ;Foo:bar

    +!! html/parsoid +

    *foo

    + +

    #foo

    + +

    ;Foo:bar

    !!end !! test @@ -23398,9 +23561,9 @@ Improperly nested inline or quotes tags with whitespace in between !!test Encapsulate protected attributes from wt !! wikitext -
    foo
    +
    foo
    !! html/parsoid -
    foo
    +
    foo
    !!end @@ -24115,9 +24278,43 @@ parsoid=html2wt !! end !! test -Headings: Force sol-transparent links and behavior switches to serialize before/after +1. Headings: Force sol-transparent links and behavior switches to serialize before/after !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": false +} +!! 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 +2. Headings: Force sol-transparent links and behavior switches to serialize before/after +!! options +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} !! html

    hello there

    hi pal

    @@ -24152,7 +24349,10 @@ __TOC__ !! test Headings: Don't hoist metas that come from templates !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} !! html

    foo

    !! wikitext @@ -24162,7 +24362,10 @@ parsoid=html2wt !! test Headings: Category in ref isn't hoisted !! options -parsoid=html2wt +parsoid={ + "modes": ["html2wt"], + "scrubWikitext": true +} !! html

    foo [1]

    @@ -24267,6 +24470,16 @@ bar baz
  3. foo bar baz
  4. + +
    hi +ho
    hi +ho
    + +
    + +
    ha +ha +ha
    !! wikitext == testing 123 == @@ -24282,6 +24495,14 @@ there
    == * foo bar baz * foo '''bar''' baz + +; hi ho : hi ho + +: {| +| ha +ha +ha +|} !! end !! test @@ -24609,6 +24830,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 @@ -24767,7 +25013,7 @@ parsoid=html2wt !! end !! test -Headings: Add space before/after == (T53744) +1. Headings: Add space before/after == (T53744) !! options parsoid=html2wt !! html @@ -24775,9 +25021,6 @@ parsoid=html2wt

    bar

    baz

    baz

    - - -

    ok

    !! wikitext == foo == @@ -24786,8 +25029,18 @@ parsoid=html2wt == 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 == @@ -24859,8 +25112,11 @@ parsoid={ } !! html

    hi

    +

    hello

    !! wikitext hi + +hello !! end !! test @@ -24869,8 +25125,99 @@ hi 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 # --------------------------------------------------- -- 2.20.1