From 9ac4ed4b4a28e4f3b42ac3f3b76875e488f25cd9 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Thu, 9 Nov 2017 19:29:48 -0500 Subject: [PATCH] Sync up with Parsoid parserTests.txt This now aligns with Parsoid commit 1d6c39d8f6f5972e72974f8d64e7a0a5c2288bf2 Change-Id: I38d9d47c9cd74257b9bedc892baad90146885ef4 --- tests/parser/parserTests.txt | 145 ++++++++++++++++++++++++++++++----- 1 file changed, 125 insertions(+), 20 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 9c92da0f2b..cef935c779 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1912,6 +1912,33 @@ a
foo

b

!! end +!! test +No p-wrappable content +!! wikitext +
x
+
x
+
x
+!! html+tidy +
x
+
x
+
x
+!! html/parsoid +
x
+
x
+
x
+!! end + +# T177612: Parsoid-only test +!! test +Transclusion meta tags shouldn't trip Parsoid's useless p-wrapper stripping code +!! wikitext +{{echo|
x
}} +x +!! html/parsoid +
x
+

x

+!! end + !! test Block tag on one line (
) !! wikitext @@ -4806,8 +4833,11 @@ foo//example.com/Foo

!! end +## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia: !! test External links: with no contents +!! options +parsoid=wt2html,wt2wt !! wikitext [http://en.wikipedia.org/wiki/Foo] @@ -5935,11 +5965,11 @@ parsoid=html2wt !! wikitext [[Foo|Bar]] [[Foo|Bar]] -[[wikipedia:Foo|Bar]] -[[wikipedia:Foo|Bar]] +[[:en:Foo|Bar]] +[[:en:Foo|Bar]] -[[wikipedia:European_Robin|European Robin]] -[[wikipedia:European_Robin|European Robin]] +[[:en:European_Robin|European Robin]] +[[:en:European_Robin|European Robin]] !! end !! test @@ -8517,6 +8547,31 @@ parsoid=html2wt,html2html Aðrir mótmælenda[[söfnuður]] !! end +!! test +Parsoid link bracket escaping +!! options +parsoid=html2wt,html2html +!! html/parsoid +

Test

+

[Test]

+

[[Test]]

+

[[[Test]]]

+

[[[[Test]]]]

+

[[[[[Test]]]]]

+!! wikitext +[[Test]] + +[[[Test]]] + +[[[[Test]]]] + +[[[[[Test]]]]] + +[[[[[[Test]]]]]] + +[[[[[[[Test]]]]]]] +!! end + !! test Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved !! wikitext @@ -8584,8 +8639,11 @@ parsoid=wt2html,wt2wt,html2html

MeatBall:

!! end +## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia: !! test Interwiki link encoding conversion (T3636) +!! options +parsoid=wt2html,wt2wt !! wikitext *[[Wikipedia:ro:Olteniţa]] *[[Wikipedia:ro:Olteniţa]] @@ -8598,6 +8656,11 @@ Interwiki link encoding conversion (T3636)
  • Wikipedia:ro:OlteniÅ£a
  • Wikipedia:ro:OlteniÅ£a
  • +!! html/parsoid + !! end !! test @@ -9411,7 +9474,7 @@ Handling html with a div self-closing tag !! html/parsoid
    -
    +
    @@ -11324,6 +11387,15 @@ Templates with templated name
    • item 1
    !! end +## Regression test; the output here isn't really that interesting. +!! test +Templates with templated name and top level template args +!! wikitext +{{1{{2{{{3}}}|4=5}}}} +!! html/parsoid +

    {{1{{2{{{3}}}|4=5}}}}

    +!! end + # Parsoid markup is deliberate "broken". This is an edge case. # See long comment in TemplateHandler.js:convertAttribsToString. !! test @@ -14762,6 +14834,28 @@ Alt image option should handle most kinds of wikitext without barfing
    This is a link and a bold template.
    This is the image caption
    !! end +!! test +Image with nested tables in caption +!! wikitext +[[File:Foobar.jpg|thumb|Foo
    +{| +| +{| +|z +|} +|} +]] +!! html/parsoid +
    Foo
    + + +
    + + +
    z
    +
    +!! end + ################### # Conflicting image format options. # First option specified should 'win'. @@ -15615,9 +15709,9 @@ T93580: 2. inside inline images !! html/parsoid -

    +

    -
    1. ↑ foo
    +
    1. ↑ foo
    !! end !! test @@ -15627,9 +15721,9 @@ T93580: 3. Templated inside inline images !! html/parsoid -

    +

    -
    1. ↑ foo
    +
    1. ↑ foo
    !! end ### @@ -18272,18 +18366,16 @@ Nested template calls ### Sanitizer ### -# HTML+Tidy effectively strips out the empty tags completely -# But since Parsoid doesn't it wraps the tags in p-tags -# which Tidy would have done for the PHP parser had there been content inside it. +# HTML+Tidy strips out empty tags completely. Parsoid doesn't. +# FIXME: Wikitext for this first test doesn't match its title. !! test Sanitizer: Closing of open tags !! wikitext
    -!! html -
    +!! html/php+tidy !! html/parsoid -

    +
    !! end !! test @@ -19993,7 +20085,7 @@ parsoid=wt2html ''''' !! html/php !! html/parsoid -

    + !! end # same html as previous, but wikitext adjusted to match parsoid html2wt @@ -22298,7 +22390,7 @@ parsoid={ |} !! end -# Tests LanguageVariantText._fromSelser +# Tests LanguageVariantText._fromSelSer !! test LanguageConverter selser (4) !! options @@ -22672,6 +22764,21 @@ a:b=>c xyz

    !! end +!! test +T179579: Nowiki and lc interaction +!! options +parsoid=wt2html +language=sr +!! wikitext +-{
    123}- + +-{123|456}- +!! html/parsoid +

    + +

    +!! end + !! test T2529: Uncovered bullet !! wikitext @@ -24448,9 +24555,7 @@ parsoid=wt2html,wt2wt !! wikitext '''[[Image:Foobar.jpg|right|300px]]''' !! html/parsoid -

    -
    -

    +
    !! end #### ---------------------------------------------------------------- -- 2.20.1