X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=f98044b57c098ee79e3db86c9b9cbe5abc2fe61a;hb=65fcb7a94528ea56d461b3c7b9cb4d4fe4e99211;hp=aa03c0ed9dd7ce42c97c9c4c53092c9196fae723;hpb=395b9c81ffcc11b6a564a26418dad990e1a708d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index aa03c0ed9d..f98044b57c 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -279,12 +279,6 @@ Template:EmptyTRWithHTMLAttrTest !!endarticle -!! article -Template:CircularRef -!! text -{{CircularRef}} -!! endarticle - !! article Template:With: Colon !! text @@ -294,22 +288,13 @@ Template with colon ### ### Basic tests ### + !! test Blank input !! wikitext !! html !! end -!! test -CircularRef -!! wikitext -{{CircularRef}} - -!! html/parsoid -

[1]

-
  1. ↑ Error: Expansion loop detected at Template:CircularRef
-!! end - !! test Simple paragraph !! wikitext @@ -572,13 +557,6 @@ http://fr.wikipedia.org/wiki/🍺

!! end -# Note that the html+tidy output removes the spaces after the
  • , -# which is a bug (https://sourceforge.net/p/tidy/bugs/945/, etc). -# This is an issue for all tests with lists. We intentionally do -# *not* add html+tidy clauses for these, as we don't want to -# document/test the broken behavior. (Parsoid matches the non-tidy -# output in these cases.) - !! test Simple list !! wikitext @@ -1149,8 +1127,7 @@ The ''[[Main Page]]'''s talk page. !! end !! test -Parsoid only: Quote balancing context should be restricted to td/th cells on the same wikitext line -(Requires tidy for PHP parser output to be fixed up) +Quote balancing context should be restricted to td/th cells on the same wikitext line !! options parsoid=wt2html,wt2wt !! wikitext @@ -1158,20 +1135,15 @@ parsoid=wt2html,wt2wt !''a!!''b |''a||''b |} -!! html/php+tidy +!! html+tidy - + - + - - -
    abb + ab
    -!! html/parsoid - - - -
    abab
    +b + !! end ### @@ -1334,11 +1306,8 @@ Non-word characters don't terminate tag names (T19663, T42670, T54022)

    !! end -# There is a tidy bug here: https://sourceforge.net/p/tidy/bugs/946/ -# If the non-word-character tag made it through the sanitizer, tidy -# would munge it up. !! test -Non-word characters don't terminate tag names + tidy +Non-word characters don't terminate tag names !! wikitext a @@ -1352,12 +1321,13 @@ Non-word characters don't terminate tag names + tidy !! html+tidy -

    <blockquote|>a

    -

    <b→> doesn't terminate </b→>

    -

    <bä> doesn't terminate </bä>

    -

    <boo> doesn't terminate </boo>

    -

    <s.foo> doesn't terminate </s.foo>

    -

    <sub-ID#1>

    +

    <blockquote|>a +

    <b→> doesn't terminate </b→> +

    <bä> doesn't terminate </bä> +

    <boo> doesn't terminate </boo> +

    <s.foo> doesn't terminate </s.foo> +

    <sub-ID#1> +

    !! end ### @@ -1390,7 +1360,9 @@ parsoid=wt2html s !! html/php+tidy -

    <s.foo>s

    +

    +

    <s.foo>s +

    !! html/parsoid

    <s.foo>s

    !! end @@ -1518,7 +1490,8 @@ Entities inside template parameters !! wikitext {{echo|–}} !! html/php+tidy -

    –

    +

    – +

    !! html/parsoid

    !! end @@ -1888,6 +1861,7 @@ IE conditional comments ### ### paragraph wrapping tests ### + !! test No block tags !! wikitext @@ -1911,21 +1885,23 @@ a
    foo

    b

    !! html+tidy -

    a

    -
    foo
    -

    b

    +

    a

    foo
    +

    b +

    !! end +# Remex wraps empty tag runs with p-tags. +# Parsoid strips them out during p-wrapping. !! test No p-wrappable content !! wikitext
    x
    x
    x
    -!! html+tidy -
    x
    -
    x
    -
    x
    +!! html/php+tidy +
    x
    +
    x
    +

    x
    !! html/parsoid
    x
    x
    @@ -1954,11 +1930,9 @@ a
    foo

    b

    !! html+tidy -

    a

    -
    -

    foo

    -
    -

    b

    +

    a

    foo

    +

    b +

    !! end !! test @@ -1972,10 +1946,8 @@ a
    foo
    b
    foo
    !! html+tidy -

    a

    -
    foo
    -

    b

    -
    foo
    +

    a

    foo

    +b

    foo
    !! end !! test @@ -1989,14 +1961,8 @@ a
    foo
    b
    foo
    !! html+tidy -

    a

    -
    -

    foo

    -
    -

    b

    -
    -

    foo

    -
    +

    a

    foo

    +b

    foo

    !! end !! test @@ -2016,19 +1982,21 @@ d e x
    foo
    z !! html+tidy -
    foo
    -

    a

    -

    b c d e

    -

    x

    -
    foo
    -

    z

    +
    foo

    a +

    b +c +d e +

    +x

    foo

    z +

    !! end -# Tidy strips out the empty
    tags. Parsoid doesn't. -# So, we have a separate section for Parsoid. We don't want -# to mimic this stripping behavior in Parsoid. It affects -# editing experience and also requires us to maintain additional -# info for RT-ing. +# The difference between Parsoid & Remex here +# is because of Parsoid's Tidy-emulation code +# for p-wrapping. We'll start work to remove this +# emulation code in Parsoid sooner than later. +# Remex wraps empty tag runs with p-tags. +# Parsoid strips them out in a separate pass. !! test Empty lines between lines with block tags !! wikitext @@ -2058,14 +2026,16 @@ b
    e
    !! html+tidy -


    -

    a

    -

    b

    -
    a
    -

    b

    -
    b
    -

    d

    -


    +
    +


    +

    +

    a +

    b +

    +
    a

    b +

    b

    d +


    +

    e
    !! html/parsoid
    @@ -2082,7 +2052,6 @@ b
    e
    !! end -## PHP parser emits output which is broken !! test Unclosed HTML p-tags should be handled properly !! wikitext @@ -2091,11 +2060,10 @@ a b !! html/php+tidy -
    -

    foo

    -
    -

    a

    -

    b

    +

    foo

    +

    a +

    b +

    !! html/parsoid

    foo

    a

    @@ -2128,9 +2096,55 @@ parsoid=wt2html

    a

    !! end +!! test +No paragraph necessary for SOL transparent template +!! wikitext +
    foo
    +[[Category:Foo]] + +
    foo
    +{{echo|[[Category:Foo]]}} +!! html/php +
    foo
    +
    foo
    + +!! html/parsoid +
    foo
    + + +
    foo
    + +!! end + +!! test +Avoid expanding multiline sol transparent template ranges unnecessarily +!! wikitext +hi + + +{{echo|
    +}} + +[[Category:Ho]] +!! html/php +

    hi +


    +
    +

    +!! html/parsoid +

    hi

    + +


    +
    +

    + + +!! end + ### ### Preformatted text ### + !! test Preformatted text !! wikitext @@ -2276,9 +2290,6 @@ Foo bar baz quux !! end -# Note that the p-wrapping is newline sensitive, which could be -# considered a bug: tidy will wrap only the 'Foo' in the example -# below in a

    tag. (see comment 23-25 of T8200) !! test T17491: / in blockquote (2) !! wikitext @@ -2289,9 +2300,8 @@ T17491: / in blockquote (2) !! html+tidy -

    -

    Foo

    -bar baz quux
    +

    Foo

    bar baz

    quux +

    !! end !! test @@ -2426,7 +2436,6 @@ parsoid=wt2html

    !! end -# Parsoid doesn't strip empty tags, like Tidy does. !! test Empty pre; pre inside other HTML tags (T56946) !! wikitext @@ -2436,20 +2445,12 @@ a foo
    
    -!! html/php
    +!! html/php+tidy
     

    a

    -
    -foo
    +
    foo
     
    
    -
    -!! html/php+tidy
    -

    a

    -
    -
    -foo
    -
    !! html/parsoid

    a

    @@ -2469,16 +2470,12 @@ HTML pre followed by indent-pre
    !! end -# Note that tidy removes the empty

    tags from the start and end. -# Parsoid does not, by design. !! test Block tag pre !! wikitext

    foo

    !! html/php+tidy -
    -foo
    -
    +

    foo

    !! html/parsoid

    foo

    !! end @@ -2641,10 +2638,8 @@ parsoid=wt2html <pre
    !! html/php+tidy -
    -x
    -
    -

    <pre

    +
    x
    +<pre
    !! html/parsoid
    x
    @@ -2694,6 +2689,17 @@ parsoid=wt2html !! end +!! test +Self-closed pre +!! wikitext +
    +!! html/php
    +
    
    +
    +!! html/parsoid
    +
    
    +!! end
    +
     !! test
     Parsoid: Don't paragraph-wrap fosterable content even if table syntax is unbalanced
     !! options
    @@ -2938,7 +2944,8 @@ Templates: Parsoid parameter escaping test 1
     !! wikitext
     {{echo|[foo]|{{echo|[bar]}}}}
     !! html/php+tidy
    -

    [foo]

    +

    [foo] +

    !! html/parsoid

    [foo]

    @@ -2949,9 +2956,10 @@ Parsoid: Pipes in external links in template parameter !! wikitext {{echo|[{{echo|http://example.com}} link]}} !! html/php+tidy -

    link

    +

    link +

    !! html/parsoid -

    link

    +

    link

    !! end !! test @@ -2959,11 +2967,10 @@ Parsoid: pipe in transclusion parameter !! wikitext {{echo|http://foo.com/a|b}} !! html/php+tidy -

    http://foo.com/a%7Cb

    +

    http://foo.com/a%7Cb +

    !! html/parsoid -

    http://foo.com/a%7Cb

    +

    http://foo.com/a%7Cb

    !! end !! test @@ -2973,7 +2980,8 @@ parsoid=html2wt,wt2wt !! wikitext {{echo|[http://foo.com/a|b a|b]}} !! html/php+tidy -

    a|b

    +

    a|b +

    !! html/parsoid

    <div>}} {{echo|}} !! html/php+tidy -

    foo|bar <div>

    +

    foo|bar +<div> + +

    !! html/parsoid

    foo|bar <div> @@ -3016,7 +3027,8 @@ parsoid=html2wt,wt2wt !! wikitext {{echo|{{echo|1=bar}}}} !! html/php+tidy -

    bar

    +

    bar +

    !! html/parsoid

    bar

    !! end @@ -3027,7 +3039,8 @@ Templates parameters with special tokenizing behavior dont get modified because !! wikitext {{echo|a : b}} !! html/php+tidy -

    a : b

    +

    a : b +

    !! html/parsoid

    a : b

    !! end @@ -3038,7 +3051,8 @@ Templates: Preserve blank parameter names !! wikitext {{echo|=foo}} !! html/php+tidy -

    {{{1}}}

    +

    {{{1}}} +

    !! html/parsoid

    {{{1}}}

    !! end @@ -3048,7 +3062,9 @@ Templates: Preserve blank parameter names in other positions !! wikitext {{blank_param|bar|=foo}} !! html/php+tidy -

    bar foo

    +

    bar +foo +

    !! html/parsoid

    bar foo

    @@ -3260,17 +3276,11 @@ a

    c

    foo
     foo 
     
    -!! html+tidy -

    a

    -

    foo

    -

    b

    -
    foo
    -

    c

    -
    -

    foo

    -
    -
    - foo 
    +!! html/php+tidy
    +

    a

    foo

    + b

    foo

    + c

    foo

    +
     foo 
     
    !! end @@ -3287,12 +3297,10 @@ a !! html/parsoid
    a foo
    b
    foo
    -!! html+tidy -
    -a foo
    -
    -

    b

    -
    foo
    +!! html/php+tidy +
    a foo
    +

    + b

    foo
    !!end !!test @@ -3527,7 +3535,8 @@ a b !! html/php+tidy -

    a b

    +

    a b +

    !! html/parsoid

    a

    +

    Google

    !! end !! test @@ -5649,7 +5500,7 @@ External link to bare IPv4 address

    Link

    !! html/parsoid -

    Link

    +

    Link

    !! end !! test @@ -5681,9 +5532,9 @@ http://example.com/index.php?foozoid[]=bar

    http://example.com/index.php?foozoid%5B%5D=bar

    !! html/parsoid -

    http://example.com/index.php?foozoid%5B%5D=bar

    +

    http://example.com/index.php?foozoid%5B%5D=bar

    -

    http://example.com/index.php?foozoid%5B%5D=bar

    +

    http://example.com/index.php?foozoid%5B%5D=bar

    !! end !! test @@ -5729,24 +5580,24 @@ Examples from RFC 2732, section 2:
  • http://[2010:836B:4179::836B:4179]
  • !! html/parsoid -

    http://[2404:130:0:1000::187:2]/index.php

    +

    http://[2404:130:0:1000::187:2]/index.php

    -

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2373, section 2.2:

    + -

    Examples from RFC 2732, section 2:

    - +

    Examples from RFC 2732, section 2:

    + !! end !! test @@ -5792,24 +5643,24 @@ Examples from RFC 2732, section 2:
  • 7
  • !! html/parsoid -

    test

    +

    test

    -

    Examples from RFC 2373, section 2.2:

    - +

    Examples from RFC 2373, section 2.2:

    + -

    Examples from RFC 2732, section 2:

    - +

    Examples from RFC 2732, section 2:

    + !! end !! test @@ -5849,13 +5700,13 @@ Non-extlinks in brackets [foo bar] [fool's] errand [fool's errand] -[foo] -[foo bar] -[foo bar] -[fool's] errand -[fool's errand] -[url=foo] -[url=http://example.com] +[foo] +[foo bar] +[foo bar] +[fool's] errand +[fool's errand] +[url=foo] +[url=http://example.com] [http:// bare protocols don't count]

    !! end @@ -5867,8 +5718,7 @@ Percent encoding in external links

    Search

    !! html/parsoid -

    Search

    +

    Search

    !! end !! test @@ -5879,7 +5729,7 @@ http://example.com

    http://example.com

    !! html/parsoid -

    http://example.com

    +

    http://example.com

    !! end !! test @@ -5911,14 +5761,14 @@ http://example.com/a)b

    foo

    !! html/parsoid -

    http://example.com)

    -

    http://example.com/test)

    -

    http://example.com/(test)

    -

    http://example.com/((test)

    -

    (http://example.com/(test))

    -

    (http://example.com/(test)))))

    -

    http://example.com/a)b

    -

    foo

    +

    http://example.com)

    +

    http://example.com/test)

    +

    http://example.com/(test)

    +

    http://example.com/((test)

    +

    (http://example.com/(test))

    +

    (http://example.com/(test)))))

    +

    http://example.com/a)b

    +

    foo

    !! end !! test @@ -5932,9 +5782,9 @@ Parenthesis in external links, w/ transclusion or comment

    (http://example.com)

    !! html/parsoid -

    (http://example.com/hi)

    +

    (http://example.com/hi)

    -

    (http://example.com)

    +

    (http://example.com)

    !! end !! test @@ -6420,15 +6270,12 @@ Accept "!!" in table data of mixed wikitext / html syntax !a b!!c |} -!! html+tidy +!! html/php+tidy - - - - - - -
    a
    b!!c
    + +a +b!!c + !! html/parsoid @@ -6630,7 +6477,7 @@ parsoid=wt2html,html2html !! html/parsoid
    a
    -
    [ftp://%7Cx]" onmouseover="alert(document.cookie)">test
    +[ftp://%7Cx]" onmouseover="alert(document.cookie)">test !! end !! test @@ -6719,7 +6566,7 @@ Don't break on | in extension attribute in template !! html/parsoid -

    [1]

    +

    [1]

    1. ↑ ha
    !! end @@ -6894,7 +6741,7 @@ T107652: s in templates that also generate table cell attributes should be !! html/parsoid - +
    Foo[1]
    Foo[1]
    1. ↑ foo
    !! end @@ -6991,10 +6838,10 @@ Wikitext table comments represented in parsoid dom |} !! html/php+tidy - - - -
    x
    + + + x + !! html/parsoid @@ -7164,7 +7011,7 @@ Wikitext table with html-syntax row !! end !! test -Implicit
    after a |- +Fostered content in tables: Plain text !! options parsoid=wt2html,html2html !! wikitext @@ -7179,7 +7026,10 @@ a
    !! html/php+tidy -

    a

    + + +a +
    !! html/parsoid

    a

    @@ -7188,7 +7038,7 @@ a !! end !! test -Lists should be recognized in an implicit
    context +Fostered content in tables: Lists !! options parsoid=wt2html,html2html !! wikitext @@ -7203,9 +7053,10 @@ parsoid=wt2html,html2html
    !! html/php+tidy -
      -
    • a
    • -
    +
    • a
    + + +
    !! html/parsoid
    • a
    @@ -7214,7 +7065,7 @@ parsoid=wt2html,html2html !! end !! test -Table cells not properly parsed in an implicit-td context +Template generated table cell with attributes !! wikitext {| |- @@ -7222,12 +7073,12 @@ Table cells not properly parsed in an implicit-td context |} !! html/php+tidy
    - - - - - -
    ab
    + + + + a + b + !! html/parsoid @@ -7248,17 +7099,14 @@ parsoid=wt2html,wt2wt |}quux !! html+tidy
    - - - -
    foo
    -

    bar

    - - - - -
    baz
    -

    quux

    + +foo +

    bar +

    + +
    baz +

    quux +

    !! end !! test @@ -7330,12 +7178,11 @@ foo |} !!html/php+tidy - + - -
    -

    foo

    -
    +

    foo +

    + !!html/parsoid @@ -7409,24 +7256,28 @@ parsoid=html2wt |} !! html/php+tidy
    - - - - - + + + + - - - + + - - - + + - - - -
    Test
    MonthSavings
    Test +
    Month +Savings +
    January$100
    January +$100 +
    February$80
    February +$80 +
    Sum$180
    +Sum + +$180 + !! end # T137406: No whitespace in the HTML @@ -8127,7 +7978,7 @@ Plain link to URL

    [[1]]

    !! html/parsoid -

    []

    +

    []

    !! end !! test @@ -8147,7 +7998,7 @@ Plain link to protocol-relative URL

    [[1]]

    !! html/parsoid -

    []

    +

    []

    !! end !! test @@ -8190,7 +8041,7 @@ Piped link to URL: [[http://www.example.com|an example URL]]

    Piped link to URL: [example URL]

    !! html/parsoid -

    Piped link to URL: [example URL]

    +

    Piped link to URL: [example URL]

    !! end !! test @@ -8212,13 +8063,13 @@ parsoid=wt2html

    [http://www.example.com

    !! html/parsoid -

    [http://www.example.com

    +

    [http://www.example.com

    -

    [|123]

    +

    [|123]

    -

    {{echo|[|123}}

    +

    {{echo|[|123}}

    -

    [http://www.example.com

    +

    [http://www.example.com

    !! end !! test @@ -8239,11 +8090,9 @@ T2337: Escaped self-links should be bold title=[[Bug462]] !! wikitext [[Bug462]] [[Bug462]] -!! html/php +!! html/php+tidy

    Bug462 Bug462

    -!! html/php+tidy -

    Bug462 Bug462

    !! html/parsoid

    Bug462 Bug462

    !! end @@ -8684,7 +8533,7 @@ parsoid=wt2html,wt2wt -!! html+tidy +!! html/php+tidy
    • Wikipedia:ro:OlteniÅ£a
    • Wikipedia:ro:OlteniÅ£a
    • @@ -8796,8 +8645,8 @@ Interwiki links that cannot be represented in wiki syntax

      meatball:ok ok with fragment ok ending with ? mark -has query -is just fragment

      +has query +is just fragment

      !! end !! test @@ -9475,8 +9324,9 @@ parsoid=wt2html
      !! html+tidy -


      -


      +


      +


      +

      !! end !! test @@ -9568,10 +9418,9 @@ foo
      bar !! html+tidy
      -
      -

      foo

      -
      -

      bar

      +

      +foo


      bar +

      !! end !! test @@ -9620,8 +9469,8 @@ Horizontal ruler -- Supports content following dashes on same line
      Foo !! html+tidy -
      -

      Foo

      +

      Foo +

      !! end ### @@ -9922,11 +9771,10 @@ Multiple list tags generated by templates !! html+tidy -
        -
      • a
      • -
      • b
      • -
      • c
      • -
      +
    • a +
    • b +
    • c +
    • !!end !!test @@ -9966,9 +9814,10 @@ Replacing whitespace with tabs still doesn't break the list (gerrit 78327) !!end +# FIXME: Parsoid has a dedicated DOM pass to mimic this Tidy-specific li-hack +# That pass could possibly be removed. !!test -Test the li-hack -(The PHP parser relies on Tidy for the hack) +Test the li-hack (a hack from Tidy days, but doesn't work as advertised with Remex) !!options parsoid=wt2html,wt2wt !! wikitext @@ -9982,14 +9831,13 @@ parsoid=wt2html,wt2wt
    !! html+tidy +
    • foo
    • +
    • li-hack
    • +
    • templated li-hack
    • +
    • unsupported li-hack with preceding comments
      -
    • foo
    • -
    • li-hack
    • -
    • templated li-hack
    • -
    • unsupported li-hack with preceding comments
    • -
    -
      -
    • not a li-hack
    • +
    • not a li-hack +
    !! html/parsoid
    • foo
    • @@ -10048,69 +9896,71 @@ parsoid # tags (parse, minimize scope of fixup, and roundtrip back) # ------------------------------------------------------------------------ +# Remex and Parsoid output stems from list handling diffs because Parsoid & PHP parser. +# Parsoid's list handling is more aware of block structure. !! test Unbalanced closing block tags break a list -(php parser relies on Tidy to fix up) !! wikitext
      *a
      *b
      !! html+tidy
      -
        +
        • a
      +
    • b
    • +!! html+parsoid +
      • a
      • -
      -
      -
      -
        +
      +
      • b
      • -
      -
      +
    !! end -# Parsoid fails this test, but it might be tricky to support properly. -# See T70395. !! test Unbalanced closing non-block tags don't break a list -(php parser relies on Tidy to fix up) !! wikitext *a *b !! html/php+tidy -
      -
    • a
    • -
    • b
    • -
    +

    +

    +
    • a
    • +
    • b
    !! html/parsoid
      -
    • a -
    • -
    • b -
    • +
    • a
    • +
    • b
    !! end +# Parsoid does some post-dom-building cleanup +# which is why its output differs from Remex. !! test Unclosed formatting tags that straddle lists are closed and reopened -(php parser relies on Tidy to fix up) !! options parsoid=wt2html,wt2wt,html2html !! wikitext # a # b !! html/php+tidy -
      -
    1. a
    2. -
    3. b
    4. -
    +
    1. a
    2. +
    3. b
    !! html/parsoid -
    1. a
    2. +
      1. a
      2. b
      !! end +# Output is ugly because of all the misnested tag fixups. +# Remex is wrapping p-tags around empty elements. +# Parsoid has special-case handling of this pattern of +# wrapping lists in formatting tags. +# FIXME: Should we remove this code from Parsoid? Or add +# special support in Remex? If the latter, maybe just wait +# for Parsoid to become the default parser. # See T70395. !!test 1. List embedded in a formatting tag @@ -10119,9 +9969,9 @@ parsoid=wt2html,wt2wt,html2html * foo !! html/php+tidy -
        -
      • foo
      • -
      +

      +

      • foo

      +

      !! html/parsoid
        @@ -10130,19 +9980,19 @@ parsoid=wt2html,wt2wt,html2html !!end -## Ugly Parsoid output here -## Not sure what the right output is. +# Output is ugly because of all the misnested tag fixups +# Remex is wrapping p-tags around empty elements. +# Parsoid has code that strips useless p-tags. !!test -2. List embedded in a formatting tag +2. List embedded in a formatting tag in a misnested way !! wikitext *a -*b -!! html/php+tidy -
          -
        • a
        • -
        • b
        • -
        +*b +!! html/php+tidy +

        +

        • a
        • +
        • b
        !! html/parsoid
          @@ -10152,31 +10002,6 @@ parsoid=wt2html,wt2wt,html2html
        !!end -# Ugly Parsoid and PHP parser output here -# Not sure if we want to make this a test! -# -## !!test -## 3. Unclosed formatting tags in list elements -## !! wikitext -## *a -## *b -## !! html/php+tidy -##
          -##
        • a
        • -##
        • b
        • -##
        -## !! html/parsoid -##
          -##
        • a
        • -## -##
        • b
        • -##
        -## !!end - -# This is a bug in the PHP parser + tidy combination. -# (The tag gets parsed as text and html-escaped by PHP, -# and then fostered out of the table by tidy.) -# We believe the Parsoid output to be correct. !! test Table with missing opening tag !! options @@ -10188,10 +10013,9 @@ parsoid=wt2html,wt2wt !! html+tidy - - + -
        foo
        foo
        + !! end ### @@ -10669,11 +10493,9 @@ title=[['foo & bar = baz']] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext ''{{PAGENAME}}'' -!! html/php +!! html+tidy

        'foo & bar = baz'

        -!! html+tidy -

        'foo & bar = baz'

        !! end !! test @@ -10683,11 +10505,9 @@ title=[[*RFC 1234 http://example.com/]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAME}} -!! html/php +!! html+tidy

        *RFC 1234 http://example.com/

        -!! html+tidy -

        *RFC 1234 http://example.com/

        !! end !! test @@ -10709,11 +10529,9 @@ title=[[*RFC 1234 http://example.com/]] parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true } !! wikitext {{PAGENAMEE}} -!! html/php +!! html+tidy

        *RFC_1234_http://example.com/

        -!! html+tidy -

        *RFC_1234_http://example.com/

        !! end !! test @@ -11053,7 +10871,7 @@ RFC 822

        RFC 822

        !! html/parsoid -

        RFC 822

        +

        RFC 822

        !! end !! test @@ -11064,7 +10882,7 @@ This is RFC 822 but thisRFC 822 is not RFC 822linked.

        This is RFC 822 but thisRFC 822 is not RFC 822linked.

        !! html/parsoid -

        This is RFC 822 but thisRFC 822 is not RFC 822linked.

        +

        This is RFC 822 but thisRFC 822 is not RFC 822linked.

        !! end !! test @@ -11079,7 +10897,7 @@ RFC 822

        !! html/parsoid -

        RFC       822 +

        RFC       822 RFC 822

        !! end @@ -11137,7 +10955,7 @@ PMID 1234

        PMID 1234

        !! html/parsoid -

        PMID 1234

        +

        PMID 1234

        !! end !! test @@ -11148,7 +10966,7 @@ This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

        This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

        !! html/parsoid -

        This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

        +

        This is PMID 1234 but thisPMID 1234 is not PMID 1234linked.

        !! end !! test @@ -11163,7 +10981,7 @@ PMID 1234

        !! html/parsoid -

        PMID       1234 +

        PMID       1234 PMID 1234

        !! end @@ -11182,7 +11000,7 @@ X[https://tools.ietf.org/html/rfc1234 foo]

        !! html/parsoid

        Xfoo

        -

        Xfoo

        +

        Xfoo

        !! end !! test @@ -11474,12 +11292,7 @@ Template with thumb image (with link in description) This is a test template with parameter !! html+tidy -

        This is a test template with parameter

        - +

        This is a test template with parameter

        !! html/parsoid

        This is a test template with parameter

        link caption
        !! end @@ -11763,21 +11576,13 @@ Templates with intersecting and overlapping ranges {{echo|{{!}}hi}} |} !! html/php+tidy -

        ha

        -

        ho

        - - - - - - - -
        hi
        - - - - -
        +

        ha

        + +

        ho

        + + +
        hi +
        !! html/parsoid

        ha

        @@ -12486,30 +12291,21 @@ tag, nothing bad happens: {{echo|foo-{bar}bat}} !! html/php+tidy -

        This form breaks the template, which is unfortunate:

        -
          -
        • {{echo|foo-{bar}bat}}
        • -
        -

        But if the broken language converter markup is inside an extension tag, nothing bad happens:

        -
          -
        • foo-{bar}bat
        • -
        • foo-{bar}bat
        • -
        • -
          -foo-{bar}bat
          -
        • -
        • -
          -foo-{bar}bat
          -
        • -
        -
        -'foo-{bar}bat'
        +

        This form breaks the template, which is unfortunate: +

        +
        • {{echo|foo-{bar}bat}}
        +

        But if the broken language converter markup is inside an extension +tag, nothing bad happens: +

        +
        • foo-{bar}bat
        • +
        • foo-{bar}bat
        • +
        • foo-{bar}bat
        • +
        • foo-{bar}bat
        +
        'foo-{bar}bat'
         array (
         )
         
        -
        -'foo-{bar}bat'
        +
        'foo-{bar}bat'
         array (
         )
         
        @@ -12537,16 +12333,14 @@ parsoid=wt2html * [http://example.com Example in -{link} description] * {{echo|[http://example.com/-{foo Breaks template, however]}} !! html/php+tidy - + !! html/parsoid !! end @@ -12557,11 +12351,9 @@ Preprocessor precedence 14: broken language converter in comment * ...extra dashes * {{echo|foobat}} ...should be ok !! html/php+tidy -
          -
        • ...should be ok
        • -
        • ...extra dashes
        • -
        • foobat ...should be ok
        • -
        +
        • ...should be ok
        • +
        • ...extra dashes
        • +
        • foobat ...should be ok
        !! html/parsoid
        • ...should be ok
        • @@ -12592,17 +12384,23 @@ __NOTOC__ __NOEDITSECTION__ 6 !! html/php+tidy

          1 foo[bar 1

          -

          1

          +

          1 +

          2 foo[[bar 2

          -

          2

          +

          2 +

          3 foo{bar 3

          -

          3

          +

          3 +

          4 foo{{bar 4

          -

          4

          +

          4 +

          5 foo{{{bar 5

          -

          5

          +

          5 +

          6 foo-{bar 6

          -

          6

          +

          6 +

          !! html/parsoid

          1 foo[bar 1

          @@ -12775,9 +12573,7 @@ Templates: 2. Inside a block tag !! html+tidy
          Foo
          -
          -

          Foo

          -
          +

          Foo

          !!end !!test @@ -12816,9 +12612,9 @@ Templates: P-wrapping: 1c. Templates on consecutive lines bar
          baz
          !! html+tidy -

          Foo

          -

          bar

          -
          baz
          +

          Foo +

          +bar

          baz
          !! end !!test @@ -13242,12 +13038,9 @@ a
        !! html+tidy -

        a

        - - - - -
        + +a +
        !! end !!test @@ -13266,14 +13059,18 @@ foo -!! html+tidy +!! html/php+tidy
        +

        foo +

        +
        + +
        +!! html/parsoid +

        foo

        -
        - - - - +
        +
        !! end @@ -13290,13 +13087,15 @@ a
        b
        -!! html+tidy -

        a

        -
        b
        - - - - +!! html/php+tidy + +a +
        b
        +
        +!! html/parsoid +

        a

        b
        + +
        !! end @@ -13366,7 +13165,7 @@ Templates: Wiki Tables: 7. Fosterable s should get fostered !!html/parsoid -[1] +[1]
        @@ -13445,78 +13244,10 @@ a
        b{{echo|c
        d}}e a
        bc
        de !! html+tidy -

        a

        -
        bc
        -

        de

        +

        a

        bc

        de +

        !! end -!!test -Templates: Ugly templates: 1. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!! wikitext -{| -|{{echo|foo}} -|bar -|} -!! html - - - - -
        foo
        -|bar -|} -!!end - -!!test -Templates: Ugly templates: 2. Navbox template parses badly leading to table misnesting -(Parsoid-centric) -!! options -parsoid -!! wikitext - - - - -
        - - -
        1. {{echo|foo
        }}
        bar 2. {{echo|baz
        }} - - - abc - - - - - - xyz - - -!! html - - - - -
        - - -
        1. foo
        bar 2. baz
        - - - abc - - - - - - xyz - - -!!end - !! test Templates: Ugly templates: 3. newline-only template parameter !! wikitext @@ -14449,6 +14180,8 @@ Titles in unlinked images (T23454) !! html/php

        stuff

        +!! html/parsoid +

        !! end !! test @@ -14545,18 +14278,11 @@ thumbsize=220 123
        Foobar.jpg
        456 !! html/php+tidy -

        123Foobar.jpg456

        -

        123

        -
        Foobar.jpg
        -

        456 123

        -
        -
        Foobar.jpg -
        -
        -
        -
        -
        -

        456

        +

        123Foobar.jpg456 +

        +123

        Foobar.jpg

        456 +123

        Foobar.jpg

        456 +

        !! html/parsoid

        123456

        123

        456

        @@ -14703,7 +14429,7 @@ Image with link parameter, wgNoFollowLinks set to false [[Image:foobar.jpg|link=http://example.com/]] !! config wgNoFollowLinks=false -!! html +!! html/php

        Foobar.jpg

        !! end @@ -14714,7 +14440,7 @@ Image with link parameter, wgNoFollowDomainExceptions [[Image:foobar.jpg|link=http://example.com/]] !! config wgNoFollowDomainExceptions='example.com' -!! html +!! html/php

        Foobar.jpg

        !! end @@ -15195,7 +14921,7 @@ thumbsize=220 !! html/parsoid -
        http://example.com
        +
        http://example.com
        !! end !! test @@ -15209,7 +14935,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid -
        Alteration
        http://example.com
        +
        Alteration
        http://example.com
        !! end !! test @@ -15269,7 +14995,7 @@ T3887: A RFC with a thumbnail
        This is RFC 12354
        !! html/parsoid -
        This is RFC 12354
        +
        This is RFC 12354
        !! end !! test @@ -15280,7 +15006,7 @@ T3887: A mailto link with a thumbnail !! html/parsoid -
        Please mailto:nobody@example.com
        +
        Please mailto:nobody@example.com
        !! end # Pending resolution to T2368 @@ -15463,7 +15189,7 @@ T5090: 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 @@ -15799,7 +15525,7 @@ T93580: 1. Templated inside block images !! html/parsoid -
        Caption with templated ref: [1]
        +
        Caption with templated ref: [1]
        1. ↑ foo
        !! end @@ -15811,7 +15537,7 @@ T93580: 2. inside inline images !! html/parsoid -

        +

        1. ↑ foo
        !! end @@ -15823,7 +15549,7 @@ T93580: 3. Templated inside inline images !! html/parsoid -

        +

        1. ↑ foo
        !! end @@ -15964,7 +15690,7 @@ Render invalid page names as plain text (T53090) [[.]] [[..]] [[foo././bar]] -[[fooxyz]]

        +[[fooxyz]]

        [[./../foo|bar]] [[foo/.|bar]] @@ -16177,7 +15903,8 @@ Bar

        Foo Bar

        Foo Bar

        Foo Bar

        -

        Foo Bar

        +

        Foo Bar

        + !! end @@ -16943,7 +16670,7 @@ http://example.com [[File:Foobar.jpg]]

        http://example.com Foobar.jpg

        !! html/parsoid -

        http://example.com

        +

        http://example.com

        !!end # Parsoid doesn't wt2wt this cleanly because it adds s. @@ -17248,7 +16975,7 @@ http://example.com[[File:Foobar.jpg]]

        http://example.comFoobar.jpg

        !! html/parsoid -

        http://example.com

        +

        http://example.com

        !!end !! test @@ -17357,6 +17084,20 @@ parsoid=wt2html,html2html
        HTML rocks
        !! end +# FIXME Parsoid doesn't actually match PHP here. +# Probably we should use the synthetic or +# extensions for this test, which are enabled when running parser tests. +!! test +Extension tag in attribute value +!! wikitext +ok +!! html/php+disabled +

        <span title="<translate>123</translate>">ok</span> +

        +!! html/parsoid +

        ok

        +!! end + !! test table with multiple empty attribute values !! options @@ -17464,11 +17205,9 @@ Remember AT&T? text with character entity: eacute !! wikitext I always thought é was a cute letter. -!! html +!! html+tidy

        I always thought é was a cute letter.

        -!! html+tidy -

        I always thought é was a cute letter.

        !! end !! test @@ -17546,12 +17285,11 @@ Ensure that HTML adoption agency algorithm is properly implemented. !! end # This was T43545 in the PHP parser. -# Note that tidy doesn't handle this correctly. !! test Nesting of !! wikitext XYZ -!! html +!! html+tidy

        XYZ

        !! end @@ -17560,22 +17298,20 @@ Nesting of # Note that there are some other nestable tags (b, i, etc) which are # not covered; see T53081 for discussion. -# Note that tidy doesn't handle this correctly. !! test Nesting of !! wikitext XYZ -!! html +!! html+tidy

        XYZ

        !! end -# Note that tidy doesn't handle this correctly. !! test Nesting of !! wikitext XYZ -!! html +!! html+tidy

        XYZ

        !! end @@ -17585,10 +17321,10 @@ Nesting of !! wikitext XYZ !! html+tidy -

        XYZ

        +

        XYZ +

        !! end -# Note that tidy doesn't handle this correctly. !! test Nesting of !! wikitext @@ -17598,7 +17334,6 @@ Nesting of

        !! end -# Note that tidy doesn't handle this correctly. !! test Nesting of !! wikitext @@ -17643,6 +17378,7 @@ Media link with text # FIXME: this is still bad HTML tag nesting # FIXME: doBlockLevels won't wrap this in a paragraph because it contains a div +# Parsoid & Remex fix the p-wrapping since they operate on the DOM. !! test Media link with nasty text !! wikitext @@ -18256,11 +17992,12 @@ Expansion of multi-line templates in attribute values (T8255 sanity check 2) !! end !! test -Tags which are hidden from Tidy cannot pass through the Sanitizer +Tags which are hidden from tidiers cannot pass through the Sanitizer !! wikitext !! html+tidy -

        <mw:toc><script>alert();</script></mw:toc>

        +

        <mw:toc><script>alert();</script></mw:toc> +

        !! end ### @@ -18565,14 +18302,14 @@ Nested template calls ### Sanitizer ### -# HTML+Tidy strips out empty tags completely. Parsoid doesn't. -# FIXME: Wikitext for this first test doesn't match its title. +# Remex wraps empty tag runs with p-tags. +# Parsoid strips them out during p-wrapping. !! test Sanitizer: Closing of open tags !! wikitext
        !! html/php+tidy - +

        !! html/parsoid
        !! end @@ -18593,6 +18330,8 @@ parsoid=wt2html !! wikitext !! html/php+tidy +

        +

        !! html/parsoid !! end @@ -18602,10 +18341,9 @@ Sanitizer: Closing of closed but not open table tags parsoid=wt2html !! wikitext Table not started -!! html/php+tidy -

        Table not started

        -!! html/parsoid -

        Table not started

        +!! html+tidy +

        Table not started +

        !! end !! test @@ -18763,7 +18501,7 @@ language=sr variant=sr-el !! html/parsoid

        -

        foAjrjvi

        +

        foAjrjvi

        !! end !! test @@ -18776,10 +18514,6 @@ Self closed html pairs (T7487)
        In div text
        !! end -# -# -# - !! test Punctuation: nbsp before exclamation !! wikitext @@ -18837,9 +18571,9 @@ HTML bullet list, unclosed tags (T7497)
      !! html/php+tidy
        -
      • One
      • -
      • Two
      • -
      +
    3. One +
    4. Two +
    5. !! html/parsoid
      • One
      • @@ -18879,9 +18613,9 @@ HTML ordered list, unclosed tags (T7497)
    !! html/php+tidy
      -
    1. One
    2. -
    3. Two
    4. -
    +
  • One +
  • Two +
  • !! html/parsoid
    1. One
    2. @@ -18936,30 +18670,15 @@ HTML nested bullet list, open tags (T7497)
    3. Sub-two -!! html/php+tidy -
        -
      • One
      • -
      • Two: -
          -
        • Sub-one
        • -
        • Sub-two
        • -
        -
      • -
      -!! html/parsoid +!! html+tidy
      • One -
      • -
      • Two: +
      • Two:
        • Sub-one -
        • -
        • Sub-two -
        • -
        -
      • -
      - +
    4. Sub-two +
    5. + !! end !! test @@ -19056,11 +18775,11 @@ mailto:inline@mail.tld

      mailto:inline@mail.tld

      !! html/parsoid -

      -

      ftp://inlineftp

      -

      With target

      -

      -

      mailto:inline@mail.tld

      +

      +

      ftp://inlineftp

      +

      With target

      +

      +

      mailto:inline@mail.tld

      !! end @@ -19102,20 +18821,15 @@ http://

      C !! html/php+tidy -

      onmouseover=[edit]

      -

      http://

      -
      -
      -

      Contents

      -
      +

      onmouseover=[edit]

      +http://

      Contents

      -

      !! html/parsoid

      onmouseover=

      -

      http://__TOC__

      +

      http://__TOC__

      !! end !! test @@ -19144,31 +18858,22 @@ parsoid=wt2html,html2html !! end # Known to produce bogus xml (extra ) +# Don't add the html/php section since it generates broken HTML !! test Fuzz testing: Parser16 !! wikitext {| !https://|||||| -!! html +!! html+tidy - + -
      https:// - -
      -!! html+tidy - - - - - - - -
      https://
      + + !! end !! test @@ -19273,7 +18978,7 @@ http://example.com junk

      http://example.com junk

      !! html/parsoid -

      http://example.com junk

      +

      http://example.com junk

      !! end !!test @@ -19284,7 +18989,7 @@ http://example.comjunk

      http://example.comjunk

      !! html/parsoid -

      http://example.comjunk

      +

      http://example.comjunk

      !! end !! test @@ -19295,12 +19000,9 @@ http://example.com
      junk
      http://example.com
      junk
      !! html/php+tidy -

      http://example.com

      -
      -junk
      -
      +

      http://example.com

      junk
      !! html/parsoid -

      http://example.com

      junk
      +

      http://example.com

      junk
      !! end !! test @@ -20359,7 +20061,7 @@ Handling of in URLs !! html/parsoid - + !! end !! test @@ -20370,7 +20072,7 @@ Handling of %0A in URLs !! html/parsoid - + !! end # The PHP parser strips the empty tags out for giggles; parsoid doesn't. @@ -20573,7 +20275,7 @@ image4 |300px| centre
    6. -
    7. +
    8. !! end @@ -20681,23 +20383,65 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
      -
    9. -
      This is a foo-bar.
      +
    10. +
      This is a foo-bar.
      +
      +

      blabla. +

      +
      +
    11. + + +!! html/parsoid + +!! end + +!! test +Gallery (without px units) +!! wikitext + +File:Foobar.jpg + +!! html/php + + +!! html/parsoid + +!! end + +!! test +Gallery (with invalid units) +!! wikitext + +File:Foobar.jpg + +!! html/php + !! html/parsoid - !! html/parsoid -