X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=05afefacff3ecc64c3e1ad7146976d20ea0035b2;hb=882323309ff1e3ee45e1e89ee8e57484f54f6e32;hp=4d6efffb52f892e67204e4049dfbe37bc8db3145;hpb=512e86f020f01055a53ee8cab5253bcd7ac5179d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 4d6efffb52..05afefacff 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 @@ -549,8 +534,8 @@ parsoid=wt2html !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== A B -C == +==A B +C== !! html/php

A B @@ -558,8 +543,8 @@ C[ A B -C

+C">A B +C !! end !! test @@ -572,58 +557,51 @@ 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 -* Item 1 -* Item 2 +*Item 1 +*Item 2 !! html - + !! end !! test Italics and bold !! wikitext -* plain -* plain''italic''plain -* plain''italic''plain''italic''plain -* plain'''bold'''plain -* plain'''bold'''plain'''bold'''plain -* plain''italic''plain'''bold'''plain -* plain'''bold'''plain''italic''plain -* plain''italic'''bold-italic'''italic''plain -* plain'''bold''bold-italic''bold'''plain -* plain'''''bold-italic'''italic''plain -* plain'''''bold-italic''bold'''plain -* plain''italic'''bold-italic'''''plain -* plain'''bold''bold-italic'''''plain -* plain l'''italic''plain -* plain l''''bold''' plain -!! html - +*plain +*plain''italic''plain +*plain''italic''plain''italic''plain +*plain'''bold'''plain +*plain'''bold'''plain'''bold'''plain +*plain''italic''plain'''bold'''plain +*plain'''bold'''plain''italic''plain +*plain''italic'''bold-italic'''italic''plain +*plain'''bold''bold-italic''bold'''plain +*plain'''''bold-italic'''italic''plain +*plain'''''bold-italic''bold'''plain +*plain''italic'''bold-italic'''''plain +*plain'''bold''bold-italic'''''plain +*plain l'''italic''plain +*plain l''''bold''' plain +!! html + !! end @@ -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 ### @@ -1275,32 +1247,33 @@ Text-level semantic html elements in wikitext !! test Ruby markup (W3C-style) !! wikitext -; Mono-ruby for individual base characters -: 日に本ほん語ご -; Group ruby -: 今日きょう -; Jukugo ruby -: 法華経ほけきょう -; Inline ruby -: 東京(とうきょう) -; Double-sided ruby -: 旧金山jiùjīnshānSan Francisco +;Mono-ruby for individual base characters +:日に本ほん語ご +;Group ruby +:今日きょう +;Jukugo ruby +:法華経ほけきょう +;Inline ruby +:東京(とうきょう) +;Double-sided ruby +:旧金山jiùjīnshānSan Francisco + ♥HeartCœur ☘ShamrockTrèfle ✶StarÉtoile !! html -
    Mono-ruby for individual base characters
    -
    日に本ほん語ご
    -
    Group ruby
    -
    今日きょう
    -
    Jukugo ruby
    -
    法華経ほけきょう
    -
    Inline ruby
    -
    東京(とうきょう)
    -
    Double-sided ruby
    -
    旧金山jiùjīnshānSan Francisco
    +
    Mono-ruby for individual base characters
    +
    日に本ほん語ご
    +
    Group ruby
    +
    今日きょう
    +
    Jukugo ruby
    +
    法華経ほけきょう
    +
    Inline ruby
    +
    東京(とうきょう)
    +
    Double-sided ruby
    +
    旧金山jiùjīnshānSan Francisco

    ♥HeartCœur ☘ShamrockTrèfle @@ -1334,11 +1307,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 +1322,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 +1361,9 @@ parsoid=wt2html s !! html/php+tidy -

    <s.foo>s

    +

    +

    <s.foo>s +

    !! html/parsoid

    <s.foo>s

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

    –

    +

    – +

    !! html/parsoid

    !! end @@ -1888,6 +1862,7 @@ IE conditional comments ### ### paragraph wrapping tests ### + !! test No block tags !! wikitext @@ -1911,21 +1886,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 +1931,9 @@ a
    foo

    b

    !! html+tidy -

    a

    -
    -

    foo

    -
    -

    b

    +

    a

    foo

    +

    b +

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

    a

    -
    foo
    -

    b

    -
    foo
    +

    a

    foo

    +b

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

    a

    -
    -

    foo

    -
    -

    b

    -
    -

    foo

    -
    +

    a

    foo

    +b

    foo

    !! end !! test @@ -2016,19 +1983,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 +2027,16 @@ b
    e
    !! html+tidy -


    -

    a

    -

    b

    -
    a
    -

    b

    -
    b
    -

    d

    -


    +
    +


    +

    +

    a +

    b +

    +
    a

    b +

    b

    d +


    +

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

    foo

    -
    -

    a

    -

    b

    +

    foo

    +

    a +

    b +

    !! html/parsoid

    foo

    a

    @@ -2128,9 +2097,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 +2291,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 +2301,8 @@ T17491: / in blockquote (2) !! html+tidy -

    -

    Foo

    -bar baz quux
    +

    Foo

    bar baz

    quux +

    !! end !! test @@ -2426,7 +2437,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 +2446,12 @@ a foo
    
    -!! html/php
    +!! html/php+tidy
     

    a

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

    a

    -
    -
    -foo
    -
    !! html/parsoid

    a

    @@ -2469,16 +2471,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 +2639,8 @@ parsoid=wt2html <pre
    !! html/php+tidy -
    -x
    -
    -

    <pre

    +
    x
    +<pre
    !! html/parsoid
    x
    @@ -2694,6 +2690,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
    @@ -2745,7 +2752,7 @@ Templates: Strip leading and trailing whitespace from named-param values
     

    b

    c

    -
    • d
    +
    • d
    !! end @@ -2766,7 +2773,7 @@ Templates: Don't strip whitespace from positional-param values e}} {{echo| -* f}} +*f}} {{echo| }}g @@ -2786,7 +2793,7 @@ Templates: Don't strip whitespace from positional-param values


    -
    • f
    +
    • f


    g
    @@ -2938,7 +2945,8 @@ Templates: Parsoid parameter escaping test 1
     !! wikitext
     {{echo|[foo]|{{echo|[bar]}}}}
     !! html/php+tidy
    -

    [foo]

    +

    [foo] +

    !! html/parsoid

    [foo]

    @@ -2949,9 +2957,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 +2968,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 +2981,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 +3028,8 @@ parsoid=html2wt,wt2wt !! wikitext {{echo|{{echo|1=bar}}}} !! html/php+tidy -

    bar

    +

    bar +

    !! html/parsoid

    bar

    !! end @@ -3027,7 +3040,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 +3052,8 @@ Templates: Preserve blank parameter names !! wikitext {{echo|=foo}} !! html/php+tidy -

    {{{1}}}

    +

    {{{1}}} +

    !! html/parsoid

    {{{1}}}

    !! end @@ -3048,7 +3063,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

    @@ -3152,15 +3169,15 @@ c 2c. Indent-Pre and tables (T44252) !! wikitext {| - |+ foo - ! | bar + |+foo + ! |bar |} !! html - -
    foo +foo
    bar +bar
    !!end @@ -3170,14 +3187,14 @@ c !! wikitext a {| - | b + |b |} !! html/php
    a
     
    -
    b +b
    !! html/parsoid @@ -3260,17 +3277,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 +3298,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 +3536,8 @@ a b !! html/php+tidy -

    a b

    +

    a b +

    !! html/parsoid

    a this text should be part of the dl +!! html/php+tidy +

    + + +
    foo +bar +
    this text should be part of the dl
    +!! html/parsoid +
    + + +
    foo +bar +
    this text should be part of the dl
    +!! end + !! test Definition Lists: Hacky use to indent tables, with comments (T65979) !! wikitext @@ -4045,22 +4074,24 @@ Table / list interaction: indented table with lists in table contents !! wikitext :{| |- -| a -* b +|a + +*b |- -| c -* d +|c + +*d |} !! html
    - -
    a -
    • b
    +
    a +
    • b
    c -
    • d
    +
    c +
    • d
    !! end @@ -4097,13 +4128,11 @@ Table / list interaction: lists nested in tables nested in indented lists !! test Definition Lists: Nesting: Multi-level (Parsoid only) -!! options -parsoid !! wikitext ;t1 :d1 ;;t2 ::d2 ;;;t3 :::d3 -!! html +!! html/parsoid
    t1
    d1
    @@ -4126,72 +4155,26 @@ parsoid !! test -Definition Lists: Nesting: Test 2 (Parsoid only) +Definition Lists: Nesting: Test 2 !! wikitext ;t1 ::d2 -!! html/php+tidy -
    -
    t1
    +!! html+tidy +
    t1
    -
    -
    d2
    -
    -
    -
    -!! html/parsoid -
    -
    t1
    -
    -
    -
    d2
    -
    -
    -
    - +
    d2
    !! end !! test -Definition Lists: Nesting: Test 3 (Parsoid only) +Definition Lists: Nesting: Test 3 !! wikitext :;t1 ::::d2 -!! html/php+tidy -
    -
    -
    -
    t1
    -
    -
    +!! html+tidy +
    t1
    -
    -
    d2
    -
    -
    -
    -
    -
    -
    -
    -!! html/parsoid -
    -
    -
    -
    t1
    -
    -
    -
    -
    -
    d2
    -
    -
    -
    -
    -
    -
    -
    - +
    d2
    !! end @@ -4216,42 +4199,30 @@ Definition Lists: Nesting: Test 4 !! test Definition Lists: Mixed Lists: Test 1 !! wikitext -:;* foo -::* bar -:; baz +:;*foo +::*bar +:;baz !! html/php -
    • foo
    • -
    • bar
    -
    baz
    +
    • foo
    • +
    • bar
    +
    baz
    !! html/php+tidy -
    -
    -
    -
    -
      -
    • foo
    • -
    • bar
    • -
    -
    -
    -
    -
    baz
    -
    -
    -
    +
    • foo
    • +
    • bar
    +
    baz
    !! html/parsoid
      -
    • foo +
    • foo
      -
    • bar +
    • bar
    -
    baz
    +
    baz
    !! end @@ -4259,11 +4230,11 @@ Definition Lists: Mixed Lists: Test 1 !! test Definition Lists: Mixed Lists: Test 2 !! wikitext -*: d1 -*: d2 +*:d1 +*:d2 !! html -
    • d1
      -
      d2
    +
    • d1
      +
      d2
    !! end @@ -4271,11 +4242,11 @@ Definition Lists: Mixed Lists: Test 2 !! test Definition Lists: Mixed Lists: Test 3 !! wikitext -*::: d1 -*::: d2 +*:::d1 +*:::d2 !! html -
    • d1
      -
      d2
    +
    • d1
      +
      d2
    !! end @@ -4298,10 +4269,10 @@ Definition Lists: Mixed Lists: Test 4 Definition Lists: Mixed Lists: Test 5 !! wikitext *:d1 -*:: d2 +*::d2 !! html
    • d1 -
      d2
    +
    d2
  • !! end @@ -4310,10 +4281,10 @@ Definition Lists: Mixed Lists: Test 5 Definition Lists: Mixed Lists: Test 6 !! wikitext #*:d1 -#*::: d3 +#*:::d3 !! html
      • d1 -
        d3
    +
    d3
    !! end @@ -4321,11 +4292,11 @@ Definition Lists: Mixed Lists: Test 6 !! test Definition Lists: Mixed Lists: Test 7 !! wikitext -:* d1 -:* d2 +:*d1 +:*d2 !! html -
    • d1
    • -
    • d2
    +
    • d1
    • +
    • d2
    !! end @@ -4333,11 +4304,11 @@ Definition Lists: Mixed Lists: Test 7 !! test Definition Lists: Mixed Lists: Test 8 !! wikitext -:* d1 -::* d2 +:*d1 +::*d2 !! html -
    • d1
    -
    • d2
    +
    • d1
    +
    • d2
    !! end @@ -4363,27 +4334,28 @@ Definition Lists: Mixed Lists: Test 10 !! end +# The Parsoid team disagrees with the PHP parser's seemingly-random +# rules regarding dd/dt on the next few tests. Parsoid is more +# consistent, and recognizes the shared nesting and keeps the +# still-open tags around until the nesting is complete. + # This is a regression test for T175099 -# html/php+tidy is insufficient since Tidy covers up the bug. -# But once Tidy is replaced with RemexHTML, html/php+tidy is good enough !! test Definition Lists: Mixed Lists: Test 11 !! wikitext -; a -:* b -!! html/* -
    a
    +;a +:*b +!! html/php +
    a
    -
    • b
    +
    • b
    +!! html/parsoid +
    a +
    • b
    !! end -# The Parsoid team disagrees with the PHP parser's seemingly-random -# rules regarding dd/dt on the next two tests. Parsoid is more -# consistent, and recognizes the shared nesting and keeps the -# still-open tags around until the nesting is complete. -# (And tidy again converts
    to
    before 'bar'.) - +# FIXME: Maybe get rid of this test? !! test Definition Lists: Mixed Lists: Test 12 !! wikitext @@ -4396,42 +4368,10 @@ Definition Lists: Mixed Lists: Test 12
    baz
    !! html/php+tidy - + !! html/parsoid !! end - -# Another case where tidy converts a
    to a
    (but Parsoid doesn't). +# FIXME: Maybe get rid of this test? # 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 -*#;*::;; foo : bar (who uses this?) -!! html/php -
        1. foo 
          -
          • bar (who uses this?)
    - +*#;*::;;foo :bar (who uses this?) !! html/php+tidy - + !! html/parsoid
    -!! html/php+tidy -
      -
    • One
    • -
    • Two: -
        -
      • Sub-one
      • -
      • Sub-two
      • -
      -
    • -
    -!! html/parsoid +!! html+tidy
    • One -
    • -
    • Two: +
    • Two:
      • Sub-one -
      • -
      • Sub-two -
      • -
      -
    • -
    - +
  • Sub-two +
  • + !! end !! test @@ -19056,11 +18868,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 @@ -19090,7 +18902,7 @@ Fuzz testing: Parser13 !! test Fuzz testing: Parser14 !! wikitext -== onmouseover= == +==onmouseover=== http://__TOC__ !! html/php

    onmouseover=[edit]

    @@ -19102,20 +18914,15 @@ http://

    C !! html/php+tidy -

    onmouseover=[edit]

    -

    http://

    -
    -
    -

    Contents

    -
    +

    onmouseover=[edit]

    +http://

    Contents

    -

    !! html/parsoid -

    onmouseover=

    -

    http://__TOC__

    +

    onmouseover=

    +

    http://__TOC__

    !! end !! test @@ -19144,43 +18951,34 @@ 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 Fuzz testing: Parser21 !! wikitext {| -! irc://{{ftp://a" onmouseover="alert('hello world');" +!irc://{{ftp://a" onmouseover="alert('hello world');" | !! html - @@ -19273,7 +19071,7 @@ http://example.com junk

    http://example.com junk

    !! html/parsoid -

    http://example.com junk

    +

    http://example.com junk

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

    http://example.comjunk

    !! html/parsoid -

    http://example.comjunk

    +

    http://example.comjunk

    !! end !! test @@ -19295,12 +19093,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 @@ -20354,23 +20149,23 @@ xxx !! test Handling of in URLs !! wikitext -** irc:// a +*irc:// a !! html/php - + !! html/parsoid - + !! end !! test Handling of %0A in URLs !! wikitext -** irc://%0Aa +*irc://%0Aa !! html/php - + !! html/parsoid - + !! end # The PHP parser strips the empty tags out for giggles; parsoid doesn't. @@ -20440,51 +20235,51 @@ Say the magic word !! options title=[[Parser test]] !! wikitext -* {{PAGENAME}} -* {{PAGENAMEE}} -* {{FULLPAGENAME}} -* {{FULLPAGENAMEE}} -* {{BASEPAGENAME}} -* {{BASEPAGENAMEE}} -* {{SUBPAGENAME}} -* {{SUBPAGENAMEE}} -* {{ROOTPAGENAME}} -* {{ROOTPAGENAMEE}} -* {{TALKPAGENAME}} -* {{TALKPAGENAMEE}} -* {{SUBJECTPAGENAME}} -* {{SUBJECTPAGENAMEE}} -* {{NAMESPACEE}} -* {{NAMESPACE}} -* {{NAMESPACENUMBER}} -* {{TALKSPACE}} -* {{TALKSPACEE}} -* {{SUBJECTSPACE}} -* {{SUBJECTSPACEE}} -* {{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} -!! html -
    • Parser test
    • -
    • Parser_test
    • -
    • Parser test
    • -
    • Parser_test
    • -
    • Parser test
    • -
    • Parser_test
    • -
    • Parser test
    • -
    • Parser_test
    • -
    • Parser test
    • -
    • Parser_test
    • -
    • Talk:Parser test
    • -
    • Talk:Parser_test
    • -
    • Parser test
    • -
    • Parser_test
    • -
    • -
    • -
    • 0
    • -
    • Talk
    • -
    • Talk
    • -
    • -
    • -
    • Template:Dynamic
    +*{{PAGENAME}} +*{{PAGENAMEE}} +*{{FULLPAGENAME}} +*{{FULLPAGENAMEE}} +*{{BASEPAGENAME}} +*{{BASEPAGENAMEE}} +*{{SUBPAGENAME}} +*{{SUBPAGENAMEE}} +*{{ROOTPAGENAME}} +*{{ROOTPAGENAMEE}} +*{{TALKPAGENAME}} +*{{TALKPAGENAMEE}} +*{{SUBJECTPAGENAME}} +*{{SUBJECTPAGENAMEE}} +*{{NAMESPACEE}} +*{{NAMESPACE}} +*{{NAMESPACENUMBER}} +*{{TALKSPACE}} +*{{TALKSPACEE}} +*{{SUBJECTSPACE}} +*{{SUBJECTSPACEE}} +*{{Dynamic|{{NUMBEROFUSERS}}|{{NUMBEROFPAGES}}|{{CURRENTVERSION}}|{{CONTENTLANGUAGE}}|{{DIRECTIONMARK}}|{{CURRENTTIMESTAMP}}|{{NUMBEROFARTICLES}}}} +!! html +
    • Parser test
    • +
    • Parser_test
    • +
    • Parser test
    • +
    • Parser_test
    • +
    • Parser test
    • +
    • Parser_test
    • +
    • Parser test
    • +
    • Parser_test
    • +
    • Parser test
    • +
    • Parser_test
    • +
    • Talk:Parser test
    • +
    • Talk:Parser_test
    • +
    • Parser test
    • +
    • Parser_test
    • +
    • +
    • +
    • 0
    • +
    • Talk
    • +
    • Talk
    • +
    • +
    • +
    • Template:Dynamic
    !! end ### Note: Above tests excludes the "{{NUMBEROFADMINS}}" magic word because it generates a MySQL error when included. @@ -20573,7 +20368,7 @@ image4 |300px| centre
  • -
  • +
  • !! end @@ -20975,7 +20770,7 @@ File:Foobar.jpg|alt=galleryalt|link=Wikilink !! html/parsoid -
    irc://{{ftp://a" onmouseover="alert('hello world');" +irc://{{ftp://a" onmouseover="alert('hello world');"
    -
    B +B
    !! html/parsoid @@ -23164,26 +22964,20 @@ language=sr !! test T2529: Uncovered bullet !! wikitext -* Foo {{bullet}} +*Foo {{bullet}} !! html -
    • Foo
    • -
    • Bar
    +
    • Foo
    • +
    • Bar
    !! end -# Plain MediaWiki does not remove empty lists, but tidy actually does. -# Templates in Wikipedia rely on this behavior, as tidy has always been -# enabled there. These tests are normally run *without* tidy, so specify the -# full output here. -# To test realistic parsing behavior, apply a tidy-like transformation to both -# the expected output and your parser's output. !! test -T2529: Uncovered bullet leaving empty list, normally removed by tidy +T2529: Uncovered bullet in a deeply nested list !! wikitext -******* Foo {{bullet}} +*******Foo {{bullet}} !! html -
                • Foo
    • -
    • Bar
    +
                • Foo
    • +
    • Bar
    !! end @@ -23199,12 +22993,12 @@ y

    - - + - - +
    1 2 +12
    3 4 +34

    y

    @@ -23213,10 +23007,10 @@ y !! test T2529: Uncovered bullet in parser function result !! wikitext -* Foo {{lc:{{bullet}} }} +*Foo {{lc:{{bullet}} }} !! html -
    • Foo
    • -
    • bar
    +
    • Foo
    • +
    • bar
    !! end @@ -23369,14 +23163,17 @@ Line two !! end +# doBlockLevels screws up this output and Remex cleans up as much as it can. +# Parsoid seems to do a better job here since its p-wrapper is probably smarter. !! test Nesting tags, paragraphs on lines which begin with
    !! wikitext
    A B !! html/php+tidy -

    A

    -

    B

    +

    A +

    B +

    !! html/parsoid

    A @@ -23396,9 +23193,8 @@ Line two Line two !! html+tidy -

    -

    Line one Line two

    -
    +

    Line one +Line two

    !! end !! test @@ -23416,10 +23212,12 @@ Line two !! html+tidy
    -

    Line one

    -Line two
    +

    Line one +

    +Line two

    !! end +# Parsoid's output is broken on this because of Tidy-compatibility cruft !! test T8200: paragraphs inside blockquotes (extra line break on close) !! wikitext @@ -23434,9 +23232,9 @@ Line two !! html+tidy -
    -

    Line one

    -

    Line two

    +

    Line one +

    Line two +

    !! end @@ -23455,13 +23253,9 @@ Line two

    -!! html+tidy -
    -

    Line one

    -

    Line two

    -
    !! end +# FIXME: Why does/should the blockquote+div combo suppress p-wrapping here? !! test Paragraphs inside blockquotes/divs (no extra line breaks) !! wikitext @@ -23540,9 +23334,11 @@ wgLinkHolderBatchSize=0 Free external link invading image caption !! wikitext [[Image:Foobar.jpg|thumb|http://x|hello]] -!! html +!! html/php
    hello
    +!! html/parsoid +
    hello
    !! end !! test @@ -23555,25 +23351,29 @@ language=fa

    [Û±]

    !! html/parsoid -

    +

    !! end !! test Multibyte character in padleft !! wikitext {{padleft:-Hello|7|Æ}} -!! html +!! html/php

    Æ-Hello

    +!! html/parsoid +

    Æ-Hello

    !! end !! test Multibyte character in padright !! wikitext {{padright:Hello-|7|Æ}} -!! html +!! html/php

    Hello-Æ

    +!! html/parsoid +

    Hello-Æ

    !! end !!test @@ -23813,7 +23613,7 @@ comment Bad images - basic functionality !! wikitext [[File:Bad.jpg]] -!! DISABLED/html/php +!! html/php+disabled !! html/parsoid

    !! end @@ -23824,7 +23624,7 @@ Bad images - T18039: text after bad image disappears Foo bar [[File:Bad.jpg]] Bar foo -!! DISABLED/html/php +!! html/php+disabled

    Foo bar

    Bar foo

    @@ -24002,13 +23802,13 @@ showindicators [[Main Page]] [[File:Foobar.jpg|25px|link=]] [[File:Foobar.jpg|25px]] -* foo -* bar +*foo +*bar foo Preformatted
    Broken tag {| class=wikitable -| cell +|cell |} Two @@ -24018,8 +23818,8 @@ paragraphs 02=Main Page 03=Foobar.jpg 04=Foobar.jpg -05=
    • foo
    • -
    • bar
    +05=
    • foo
    • +
    • bar
    06=foo 07=
    Preformatted
    @@ -24028,7 +23828,7 @@ paragraphs
     
     09=
    -
    cell +cell
    10=

    Two @@ -24295,7 +24095,7 @@ T28375: TOC with italics title=[[Main Page]] !! wikitext __TOC__ -== ''Lost'' episodes == +==''Lost'' episodes== !! html/php

    Contents

      @@ -24307,7 +24107,7 @@ __TOC__ !! html/parsoid -

      Lost episodes

      +

      Lost episodes

      !! end !! test @@ -24316,7 +24116,7 @@ T28375: TOC with bold title=[[Main Page]] !! wikitext __TOC__ -== '''should be bold''' then normal text == +=='''should be bold''' then normal text== !! html/php

      Contents

        @@ -24328,7 +24128,7 @@ __TOC__ !! html/parsoid -

        should be bold then normal text

        +

        should be bold then normal text

        !! end !! test @@ -24337,7 +24137,7 @@ T35845: Headings become cursive in TOC when they contain an image title=[[Main Page]] !! wikitext __TOC__ -== Image [[Image:foobar.jpg]] == +==Image [[Image:foobar.jpg]]== !! html/php

        Contents

          @@ -24349,7 +24149,7 @@ __TOC__ !! html/parsoid -

          Image

          +

          Image

          !! end !! test @@ -24358,7 +24158,7 @@ T35845 (2): Headings become bold in TOC when they contain a blockquote title=[[Main Page]] !! wikitext __TOC__ -==
          Quote
          == +==
          Quote
          == !! html/php

          Contents

            @@ -24369,24 +24169,16 @@ __TOC__

            Quote
            [edit]

            !! html/php+tidy -

            -
            -
            -

            Contents

            -
            +

            Contents

            -

            -

            -
            -

            Quote

            -
            -

            [edit]

            + +

            Quote

            [edit]

            !! html/parsoid -

            Quote

            +

            Quote

            !! end !! test @@ -24397,7 +24189,7 @@ wgFragmentMode=[ 'html5', 'legacy' ] title=[[Main Page]] !! wikitext __TOC__ -== Proof: 2 < 3 == +==Proof: 2 < 3== Hanc marginis exiguitas non caperet. QED !! html/php @@ -24413,7 +24205,7 @@ QED

            !! html/parsoid -

            Proof: 2 < 3

            +

            Proof: 2 < 3

            Hanc marginis exiguitas non caperet. QED

            !! end @@ -24422,9 +24214,9 @@ QED

            Multiple tags in TOC !! wikitext __TOC__ -== Foo Bar == +==Foo Bar== -== Foo
            Bar
            == +==Foo
            Bar
            == !! html/php

            Contents

              @@ -24437,28 +24229,20 @@ __TOC__

              Foo
              Bar
              [edit]

              !! html/php+tidy -

              -
              -
              -

              Contents

              -
              + -

              +

              Foo Bar[edit]

              -

              Foo

              -
              -

              Bar

              -
              -

              [edit]

              +

              Foo

              Bar

              [edit]

              !! html/parsoid -

              Foo Bar

              +

              Foo Bar

              -

              Foo
              Bar

              +

              Foo
              Bar

              !! end # Don't expect Parsoid to roundtrip this until the php parser comes closer to @@ -24469,9 +24253,9 @@ Tags with parameters in TOC parsoid=wt2html !! wikitext __TOC__ -== Hello == +==Hello== -== Evilbye == +==Evilbye== !! html/php

              Contents

                @@ -24485,24 +24269,24 @@ __TOC__ !! html/parsoid -

                Hello

                +

                Hello

                -

                b">Evilbye

                +

                b">Evilbye

                !! end !! test span tags with directionality in TOC !! wikitext __TOC__ -== C++ == +==C++== -== זבנג! == +==זבנג!== -== The attributes on these span tags must be deleted from the TOC == +==The attributes on these span tags must be deleted from the TOC== -== All attributes on these span tags must be deleted from the TOC == +==All attributes on these span tags must be deleted from the TOC== -== Attributes after dir on these span tags must be deleted from the TOC == +==Attributes after dir on these span tags must be deleted from the TOC== !! html/php

                Contents

                  @@ -24522,18 +24306,18 @@ __TOC__ !! html/parsoid -

                  C++

                  -

                  זבנג!

                  -

                  The attributes on these span tags must be deleted from the TOC

                  -

                  All attributes on these span tags must be deleted from the TOC

                  -

                  Attributes after dir on these span tags must be deleted from the TOC

                  +

                  C++

                  +

                  זבנג!

                  +

                  The attributes on these span tags must be deleted from the TOC

                  +

                  All attributes on these span tags must be deleted from the TOC

                  +

                  Attributes after dir on these span tags must be deleted from the TOC

                  !! end !! test T74884: bdi element in ToC !! wikitext __TOC__ -== test == +==test== !! html/php

                  Contents

                    @@ -24545,14 +24329,14 @@ __TOC__ !! html/parsoid -

                    test

                    +

                    test

                    !! end !! test T35715: s/strike element in ToC !! wikitext __TOC__ -== test test test == +==test test test== !! html/php

                    Contents

                      @@ -24564,17 +24348,14 @@ __TOC__ !! html/parsoid -

                      test test test

                      +

                      test test test

                      !! end -# Note that the html output does not have the

                      , but the -# html+tidy output *does*. This is because the empty

                      is -# removed by the sanitizer, but only when tidy is *not* enabled (!). !! test Empty

                      tag in TOC, removed by Sanitizer (T92892) !! wikitext __TOC__ -== x == +==x== !! html/php

                      Contents

                        @@ -24584,21 +24365,9 @@ __TOC__

                        x[edit]

                        -!! html/php+tidy -

                        -
                        -
                        -

                        Contents

                        -
                        - -
                        -

                        -

                        x[edit]

                        !! html/parsoid -

                        x

                        +

                        x

                        !! end !! article @@ -24750,17 +24519,17 @@ new support for bdi element (T33817) Ignore pipe between table row attributes !! wikitext {| -| quux +|quux |- id=foo | style='color: red' -| bar +|bar |} !! html - -
                        quux +quux
                        bar +bar
                        !! end @@ -24774,15 +24543,46 @@ Language parser function

                        !! end +!!test +Padleft and padright (default 0-padding) +!! wikitext +{{padleft:xyz|5}} +{{padright:xyz|5}} +!! html/php +

                        00xyz +xyz00 +

                        +!! html/parsoid +

                        00xyz +xyz00

                        +!! end + +!!test +Padleft and padright (partial fill) +!! wikitext +{{padleft:xyz|6|ab}} +{{padright:xyz|6|ab}} +!! html/php +

                        abaxyz +xyzaba +

                        +!! html/parsoid +

                        abaxyz +xyzaba

                        +!! end + !!test Padleft and padright as substr !! wikitext {{padleft:|3|abcde}} {{padright:|3|abcde}} -!! html +!! html/php

                        abc abc

                        +!! html/parsoid +

                        abc +abc

                        !! end !!test @@ -24806,7 +24606,7 @@ T36939 - Case insensitive link parsing ([HttP://])

                        [1]

                        !! html/parsoid -

                        +

                        !! end !!test @@ -24826,7 +24626,7 @@ HttP://MediaWiki.Org/

                        HttP://MediaWiki.Org/

                        !! html/parsoid -

                        HttP://MediaWiki.Org/

                        +

                        HttP://MediaWiki.Org/

                        !! end !!test @@ -24835,11 +24635,11 @@ Disable TOC notoc !! wikitext Lead -== Section 1 == -== Section 2 == -== Section 3 == -== Section 4 == -== Section 5 == +==Section 1== +==Section 2== +==Section 3== +==Section 4== +==Section 5== !! html

                        Lead

                        @@ -25009,6 +24809,7 @@ Empty LI and TR nodes should not be stripped from top-level content * a * * b + {| |- |- @@ -25363,6 +25164,21 @@ a !! end +!! test +Headings: Used as horizontal rule +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! options +parsoid=wt2html +!! wikitext +=============== +!! html/php +
                        ===[edit]
                        + +!! html/parsoid +
                        ===
                        +!! end + #### --------------- Lists --------------- #### 0. Outside nests (*foo, etc.) #### 1. Nested inside html
                        • *foo
                        @@ -25669,15 +25485,12 @@ parsoid=html2wt |} !! html/php+tidy + + - - - - - -
                        foo|bar +
                        foo|bar
                        x -
                        a|b
                        -
                        +x
                        a|b
                        + !! end !! test @@ -25952,9 +25765,9 @@ parsoid=html2wt !! html/php - -
                        <foo +<foo bar> +bar>
                        !! end @@ -26786,8 +26599,8 @@ parsoid=wt2html,html2html !! wikitext
                        -

                        Foo

                        +

                        Foo +

                        !! html/parsoid

                        Foo

                        !! end @@ -26844,12 +26657,12 @@ parsoid=wt2html,html2html Accept empty td cell attribute !! wikitext {| -| align="center" | foo || | +| align="center" |foo|| | |} !! html - +
                        foo foo
                        @@ -26859,13 +26672,13 @@ Accept empty td cell attribute Non-empty attributes in th-cells !! wikitext {| -! Foo !! style="color: red" | Bar +!Foo!! style="color: red" |Bar |} !! html - - +
                        Foo Bar +FooBar
                        !!end @@ -26874,13 +26687,13 @@ Non-empty attributes in th-cells Accept empty attributes in th-cells !! wikitext {| -!| foo !!| bar +!|foo!!|bar |} !! html - - +
                        foo bar +foobar
                        !!end @@ -26889,17 +26702,17 @@ Accept empty attributes in th-cells Empty table rows go away !! wikitext {| -| Hello -| there +|Hello +|there |- class="foo" |- |} !! html - -
                        Hello +Hello there +there
                        @@ -26929,11 +26742,9 @@ RT-ed inter-element separators should be valid separators !!end -# Parsoid-only since PHP parser relies on Tidy for correct output +# Parsoid-only test of a DOM pass !!test Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out -!!options -parsoid !! wikitext {| |foo @@ -26943,7 +26754,7 @@ bar {| |foo |} -!! html +!! html/parsoid @@ -27043,13 +26854,13 @@ Indent and comment before table row !! wikitext {| |- - | there + |there |} !! html/php
                        foo

                        bar

                        -
                        there +there
                        !! html/parsoid @@ -27982,7 +27793,7 @@ parsoid=html2wt !! html/parsoid
                        • a
                          b
                        • c
                        !! wikitext -* a
                        b +* a
                        b * c !! end @@ -28515,7 +28326,7 @@ WTS of autolinks with nowikis (round-trip) !! wikitext xhttp://cscott.netx !! html/parsoid -

                        xhttp://cscott.netx

                        +

                        xhttp://cscott.netx

                        !! end # this is the "easy" test because it leaves in place all the @@ -28583,18 +28394,25 @@ Magic links inside links (not autolinked) [http://foo.com PMID 1234] [http://foo.com ISBN 123456789x] !! html+tidy -

                        http://example.com RFC 1234 PMID 1234 ISBN 123456789x

                        -

                        http://example.com RFC 1234 PMID 1234 ISBN 123456789x

                        +

                        http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x +

                        http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x +

                        !! html/parsoid

                        http://example.com RFC 1234 PMID 1234 ISBN 123456789x

                        -

                        http://example.com -RFC 1234 -PMID 1234 -ISBN 123456789x

                        +

                        http://example.com +RFC 1234 +PMID 1234 +ISBN 123456789x

                        !! end !! test @@ -28605,38 +28423,14 @@ Magic links inside image captions (autolinked) [[File:Foobar.jpg|thumb|PMID 1234]] [[File:Foobar.jpg|thumb|ISBN 123456789x]] !! html+tidy -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -!! html/parsoid -
                        http://example.com
                        -
                        RFC 1234
                        -
                        PMID 1234
                        + + + + +!! html/parsoid +
                        http://example.com
                        +
                        RFC 1234
                        +
                        PMID 1234
                        ISBN 123456789x
                        !! end @@ -28699,31 +28493,34 @@ parsoid=html2wt,wt2wt |- |- |- -|
                        +|
                        - -|
                        +|
                        - |} !! html/php+tidy + + + - - - - - - - + + - - - -
                        - +- +
                        --
                        --
                        - +- +
                        -
                        -

                        -

                        +
                        -
                        -

                        -

                        +

                        - +

                        +
                        +

                        - +

                        + !! end !! test @@ -28907,7 +28704,7 @@ parsoid=wt2html !! wikitext {{echo|hi}}[http://example.com [[ho]]] !! html/parsoid -

                        hiho

                        +

                        hiho

                        !! end !! test @@ -29151,7 +28948,7 @@ parsoid={ !! html/parsoid

                        foo
                        bar

                        !! wikitext -== foo
                        bar == +== foo
                        bar == !! end !! test @@ -29682,6 +29479,64 @@ y }} !! end +!! test +New list is serialized on newlines +!! options +parsoid=html2wt +!! html/parsoid +

                        The quick brown fox jumps over the lazy dog.

                          +
                        • Yesterday
                        • +
                        • Today
                        • +
                        • Tomorrow
                        • +

                        The quick onyx goblin jumps over the lazy dwarf.

                        +!! wikitext +The quick brown fox jumps over the lazy dog. + +* Yesterday +* Today +* Tomorrow + +The quick onyx goblin jumps over the lazy dwarf. +!! end + +!! test +New lists in formatting elements serialized w/o newlines +!! options +parsoid=html2wt +!! html/parsoid + + +
                          +
                        • 123
                        • +
                        + +
                        + +
                        • hi
                        +!! wikitext + +* 123 + + + +* hi + +!! end + +!! test +New list in table doesn't need newlines +!! options +parsoid=html2wt +!! html/parsoid +
                        • test
                        • 123
                        +!! wikitext +{| +| +* test +* 123 +|} +!! end + # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # --------------------------------------------------- @@ -29861,17 +29716,15 @@ parsoid={ !! test Empty LI (T49673) !! wikitext -* a +*a * * -* b -!! html/php+tidy -
                          -
                        • a
                        • +*b +!! html+tidy +
                          • a
                          • -
                          • b
                          • -
                          +
                        • b
                        !! end !! test @@ -29879,13 +29732,9 @@ Thumbnail output !! wikitext [[File:Thumb.png|thumb]] !! html/php+tidy -
                        -
                        Thumb.png -
                        -
                        -
                        -
                        -
                        +
                        Thumb.png
                        +!! html/parsoid +
                        !! end !! test @@ -30000,14 +29849,14 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103 !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== A&B&C&amp;D&amp;amp;E == +==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

                        A&B&C&amp;D&amp;amp;E[edit]

                        #A&B&C&amp;D&amp;amp;E

                        !! html/parsoid -

                        A&B&C&amp;D&amp;amp;E

                        +

                        A&B&C&amp;D&amp;amp;E

                        #A&B&C&amp;D&amp;amp;E

                        !! end @@ -30016,7 +29865,7 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103 !! config wgFragmentMode=[ 'legacy' ] !! wikitext -== A&B&C&amp;D&amp;amp;E == +==A&B&C&amp;D&amp;amp;E== [[#A&B&C&amp;D&amp;amp;E]] !! html/php

                        A&B&C&amp;D&amp;amp;E[edit]

                        @@ -30069,17 +29918,17 @@ HTML5 ids: fallback to legacy !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -30110,20 +29959,20 @@ wgFragmentMode=[ 'html5', 'legacy' ]

                        #啤酒 #啤酒

                        !! html/parsoid -

                        Foo bar

                        +

                        Foo bar

                        -

                        foo Bar

                        +

                        foo Bar

                        -

                        Тест

                        +

                        Тест

                        -

                        Тест

                        +

                        Тест

                        -

                        тест

                        +

                        тест

                        -

                        Hey < # " > % : '

                        +

                        Hey < # " > % : '

                        #Foo bar #foo Bar #Тест #тест #Hey < # " > % : '

                        -

                        💩

                        +

                        💩

                        #啤酒 #啤酒

                        @@ -30135,17 +29984,17 @@ HTML5 ids: legacy with a fallback to modern !! config wgFragmentMode=[ 'legacy', 'html5' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -30183,17 +30032,17 @@ HTML5 ids: no legacy !! config wgFragmentMode=[ 'html5' ] !! wikitext -== Foo bar == +==Foo bar== -== foo Bar == +==foo Bar== -== Тест == +==Тест== -== Тест == +==Тест== -== тест == +==тест== -== Hey < # " > % : ' == +==Hey < # " > % : '== [[#Foo bar]] [[#foo Bar]] [[#Тест]] [[#тест]] [[#Hey < # " > % : ']] {{anchorencode:💩}} @@ -30230,13 +30079,16 @@ T90902: Normalize weird characters in section IDs !! config wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -== Foo bar == +==Foo bar== [[#Foo bar]] !! html/php

                        Foo bar[edit]

                        #Foo bar

                        +!! html/parsoid +

                        Foo bar

                        +

                        #Foo bar

                        !! end !! test @@ -30250,8 +30102,8 @@ T51672: Test for brackets in attributes of elements in external link texts link span

                        !! html/parsoid -

                        link span -link span

                        +

                        link span +link span

                        !! end !! test @@ -30292,40 +30144,40 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a -= 2 = +=2= b -== 2.1 == +==2.1== c -== 2.2 == +==2.2== d -=== 2.2.1 === +===2.2.1=== e -= 3 = +=3= f !! html/parsoid -

                        1

                        +

                        1

                        a

                        -

                        2

                        +

                        2

                        b

                        -

                        2.1

                        +

                        2.1

                        c

                        -

                        2.2

                        +

                        2.2

                        d

                        -

                        2.2.1

                        +

                        2.2.1

                        e

                        -

                        3

                        +

                        3

                        f

                        @@ -30344,13 +30196,13 @@ Para 2 with a
                        nested in it
                        Para 3. -= 1 = +=1= a -= 2 = +=2= b -== 2.1 == +==2.1== c !! html/parsoid

                        Para 1.

                        @@ -30359,13 +30211,13 @@ c

                        Para 3.

                        -

                        1

                        +

                        1

                        a

                        -

                        2

                        +

                        2

                        b

                        -

                        2.1

                        +

                        2.1

                        c

                        @@ -30378,29 +30230,29 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.1 == +==1.1== b }} -== 1.2 == +==1.2== c -= 2 = +=2= d !! html/parsoid -

                        1

                        +

                        1

                        a

                        -

                        1.1

                        +

                        1.1

                        b

                        -

                        1.2

                        +

                        1.2

                        c

                        -

                        2

                        +

                        2

                        d

                        !! end @@ -30414,26 +30266,26 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.1 == +==1.1== b -=== 1.1.1 === +===1.1.1=== d }} -= 2 = +=2= e !! html/parsoid -

                        1

                        +

                        1

                        a

                        -

                        1.1

                        +

                        1.1

                        b

                        -

                        1.1.1

                        +

                        1.1.1

                        d

                        -

                        2

                        +

                        2

                        e

                        !! end @@ -30447,32 +30299,32 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= x -== 1.1 == +==1.1== b ==1.2== c ===1.2.1=== d }} -= 2 = +=2= e !! html/parsoid

                        1

                        a

                        -

                        x

                        -

                        1.1

                        +

                        x

                        +

                        1.1

                        b

                        1.2

                        c

                        1.2.1

                        d

                        -

                        2

                        +

                        2

                        e

                        !! end @@ -30491,7 +30343,7 @@ parsoid={ a {{echo| -= 1 = +=1= b }} @@ -30501,8 +30353,8 @@ c

                        a

                        - -

                        1

                        + +

                        1

                        b

                        @@ -30521,32 +30373,32 @@ parsoid={ "wrapSections": true } !! wikitext -= 1 = +=1= a {{echo|1= -= 2 = +=2= b -== 2.1 == +==2.1== c }} d -= 3 = +=3= e !! html/parsoid -

                        1

                        +

                        1

                        a

                        -

                        2

                        +

                        2

                        b

                        -

                        2.1

                        +

                        2.1

                        c

                        d

                        -

                        3

                        +

                        3

                        e

                        !! end @@ -30564,31 +30416,31 @@ parsoid={ "modes": ["wt2html", "wt2wt"] } !! wikitext -= 1 = +=1= a {{echo|1= -== 1.2 == +==1.2== b -= 2 = +=2= c }} d -= 3 = +=3= e !! html/parsoid -

                        1

                        +

                        1

                        a

                        -

                        1.2

                        +

                        1.2

                        b

                        -

                        2

                        +

                        2

                        c

                        d

                        -

                        3

                        +

                        3

                        e

                        !! end @@ -30602,39 +30454,39 @@ parsoid={ foo
                        -= 1 = +=1= a -== 1.1 == +==1.1== b -= 2 = +=2= c
                        -= 3 = +=3= d -== 3.1 == +==3.1== e !! html/parsoid

                        foo

                        -

                        1

                        +

                        1

                        a

                        -

                        1.1

                        +

                        1.1

                        b

                        -

                        2

                        +

                        2

                        c

                        -

                        3

                        +

                        3

                        d

                        -

                        3.1

                        +

                        3.1

                        e

                        !! end @@ -30648,44 +30500,44 @@ parsoid={ !! wikitext foo -= 1 = +=1= a
                        b -== 1.1 == +==1.1== c -= 2 = +=2= d
                        e -= 3 = +=3= f -== 3.1 == +==3.1== g !! html/parsoid

                        foo

                        -

                        1

                        +

                        1

                        a

                        b

                        -

                        1.1

                        +

                        1.1

                        c

                        -

                        2

                        +

                        2

                        d

                        e

                        -

                        3

                        +

                        3

                        f

                        -

                        3.1

                        +

                        3.1

                        g

                        !! end @@ -30701,21 +30553,21 @@ foo

                        a

                        -= b = +=b=

                        c

                        -= d = +=d= !! html/parsoid

                        foo

                        a

                        -

                        b

                        +

                        b

                        c

                        -

                        d

                        +

                        d

                        !! end !! test @@ -30727,18 +30579,18 @@ parsoid={ !! wikitext -= 1 = +=1= a -= 2 = +=2= b !! html/parsoid
                        -

                        1

                        +

                        1

                        a

                        -

                        2

                        +

                        2

                        b

                        !! end @@ -30751,15 +30603,211 @@ parsoid={ !! wikitext foo {{echo|
                        -== a == -== b == +==a== +==b==
                        }} !! html/parsoid

                        foo

                        -
                        -

                        a

                        -

                        b

                        +
                        +

                        a

                        +

                        b

                        !! end + +########################################################################## +Tests demonstrating white-space insensitivity in input wikitext +for wikitext headings, wikitext list items, and wikitext table captions, +headings, and cells. HTML versions of the same should preserve whitespace. +########################################################################## +!! test +Trim whitespace in wikitext headings, list items, table captions, headings, and cells +!! wikitext +__NOTOC__ +== Spaces == +== Tabs == +* List item +; term : definition +{| +|+ Table Caption +|- +! Table Heading 1 !! Table Heading 2 +|- +| Table Cell 1 || Table Cell 2 +|- +| class="foo" || Table Cell 3 +|- +| testing [[one|two]] | some content +|} +: {| + | Table Cell 1 || Table Cell 2 + |} foo +!! html/php+tidy +

                        Spaces[edit]

                        +

                        Tabs[edit]

                        +
                        • List item
                        +
                        term 
                        +
                        definition
                        + + + + + + + + + + + + +
                        Table Caption +
                        Table Heading 1Table Heading 2 +
                        Table Cell 1Table Cell 2 +
                        class="foo"Table Cell 3 +
                        testing two | some content +
                        +
                        + + +
                        Table Cell 1Table Cell 2 +
                        foo
                        +!! end + +# Looks like is not accepted in HTML +!! test +Do not trim whitespace in HTML headings, list items, table captions, headings, and cells +!! wikitext +__NOTOC__ +

                        Heading

                        +
                        • List item
                        + + + +
                        Table Heading
                        Table Cell
                        +!! html/php+tidy +

                        Heading

                        +
                        • List item
                        + + + +
                        Table Heading
                        Table Cell
                        +!! end + +!! test +Do not trim whitespace in links and quotes +!! wikitext +foo '' italic '' and ''' bold ''' +[[Foo| some text ]] +!! html/php+tidy +

                        foo italic and bold + some text +

                        +!! end + +!! test +Remove p tags surrounding a single element in a figcaption +!! options +parsoid=html2wt +!! wikitext +[[File:Foobar.jpg|right|200x200px|Caption]] +!! html/parsoid +

                        Caption

                        +!! end + +!! test +Selser preserves lack of newline before list and allows newline after the list +!! options +parsoid={ + "modes": ["selser"], + "scrubWikitext": true, + "changes": [ + [ "ul", "after", "

                        footer

                        " ] + ] +} +!! wikitext +header +*foo +*bar +!! wikitext/edited +header +*foo +*bar + +footer +!! end + + +!! test +Selser does not introduce newlines between unedited paragraph preceding the list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "table tbody tr td p:last-child", "empty" ] + ] +} +!! wikitext +{| +| +header +*foo +*bar +footer +|} +!! wikitext/edited +{| +| +header +*foo +*bar + +|} +!! end + +!! test +Selser does not introduce newlines between unedited paragraph following the list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "table tbody tr td p:first-child", "empty" ] + ] +} +!! wikitext +{| +| +header +*foo +*bar +footer +|} +!! wikitext/edited +{| +| + +*foo +*bar +footer +|} +!! end + +!! test +Remove a list item but do not insert newline above list +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "ul li:last-child", "remove" ] + ] +} +!! wikitext +header +*foo +*bar +footer +!! wikitext/edited +header +*foo +footer +!! end