From: Subramanya Sastry Date: Mon, 2 Jun 2014 14:52:49 +0000 (-0500) Subject: Sync up with Parsoid parserTests. X-Git-Tag: 1.31.0-rc.0~15505^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=171f557f8de2e794f929741a0126a2515e9fe8cc;p=lhc%2Fweb%2Fwiklou.git Sync up with Parsoid parserTests. This now aligns with Parsoid commit 04a4bf2ba42c2ed568ef9e9c4679922f17b464d0 Change-Id: I330c1891efd47a4342474774c39dfc963b0ec13d --- diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 569c165321..3e66bdda85 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1992,11 +1992,34 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content Things that look like
 tags aren't treated as such
 !! wikitext
 Barack Obama  of the United States
+
 !! html
 

Barack Obama <President> of the United States +<President></President>

!! end +## PHP parser discards the "
x
}} + +
+!! html/php
+
x
+
+ +!! html/parsoid +<pre +
x
+ +<pre +
+!! end + !! test Parsoid: handle pre with space after attribute !! options @@ -2689,8 +2712,81 @@ foo foo
+!! html/parsoid +
foo
+ +
+foo
+
+ +
+
+foo
+
+ +
+
+
+foo
+
!!end +!! test +HTML-pre: big spaces +!! wikitext +
+
+
+
+
+haha
+
+
+
+
+haha
+
+
+
+
+
+!! html +
+
+
+
+
+haha
+
+
+
+
+haha
+
+
+
+
+
+ +!! html/parsoid +
+
+
+
+
+haha
+
+
+
+
+haha
+
+
+
+
+
+!! end + !!test HTML-pre: 2: indented text !! wikitext @@ -3839,6 +3935,20 @@ foo//example.com/Foo

!! end +!! test +External links: with no contents +!! wikitext +[http://en.wikipedia.org/wiki/Foo] + +[[wikipedia:Foo|Bar]] + +[[wikipedia:Foo|Bar]] +!! html/parsoid +

+

Bar

+

Bar

+!! end + !! test External image !! wikitext @@ -4344,6 +4454,50 @@ Anchor containing a #. (bug 63430)

Main Page#And#Link

!! end +# Note that parsoid does not munge anchor text; all non-space +# characters are valid in HTML5 ids. +!! test +Anchor containing a #. (bug 63430) +!! wikitext +[[Main Page#And#Link]] +!! html/php +

Main Page#And#Link +

+!! html/parsoid +

Main Page#And#Link

+!! end + +!! test +External link containing a period in the anchor. (bug 63947) +!! wikitext +[//foo.org/bar#baz. bang] + +[//foo.org/bar. bang] +!! html/php +

bang +

bang +

+!! html/parsoid +

bang

+

bang

+!! end + +!! test +External link containing a single quote. (bug 63947) +!! wikitext +[//foo.org/bar'baz] + +[//foo.org/bar'baz bang] +!! html/php +

[1] +

bang +

+!! html/parsoid +

+

bang

+!! end + + !! test External link containing a period in the anchor. (bug 63947) !! wikitext @@ -4562,7 +4716,7 @@ Parenthesis in external links, w/ transclusion or comment

(http://example.com)

!! html/parsoid -

(http://example.com/hi)

+

(http://example.com/hi)

(http://example.com)

!! end @@ -5411,6 +5565,41 @@ parsoid=html2wt a

foo

!! end +!! test +Parsoid: Row-syntax table headings followed by comment & table cells +!! options +parsoid=wt2html,wt2wt +!! wikitext +{| +! foo || bar + || baz || quux +|} +!! html/parsoid + + + + +
foo bar baz quux
+!! end + + +!!test +Parsoid: Recover better from broken table attributes +!!options +parsoid=wt2html +!!wikitext +{| class="foo +| class="bar" | +foo +|} +!!html/parsoid + + + +
+

foo

+!!end + ### ### Internal links ### @@ -5602,6 +5791,15 @@ Link to namespaces

!! end +!! test +Link with space in namespace +!! wikitext +[[User talk:Foo bar]] +!! html +

User talk:Foo bar +

+!! end + !! article MemoryAlpha:AlphaTest !! text @@ -6356,8 +6554,7 @@ parsoid !! wikitext [[ko:]] !! html -

-

+

!! end !! test @@ -6406,6 +6603,17 @@ parsoid=wt2html,wt2wt !! end +!! test +Empty redirect +!! options +parsoid=wt2html,wt2wt +!! wikitext +#REDIRECT [[]] +!! html +
    +
  1. REDIRECT [[]]
+!! end + !! test Optional colon in #REDIRECT !! options @@ -6567,8 +6775,11 @@ Parsoid: Broken br tag recognition parsoid=wt2html !! wikitext
+ +
!! html/parsoid


+


!! end !! test @@ -8871,6 +9082,44 @@ parsoid !!end +### +### Token Stream Patcher tests +### +### These tests won't always pass wt2wt and other modes because +### on serialization, the table will be output on a new line. +### For now, we are blacklisting them, and using this to test selser. +### + +!!test +1. Table tag in SOL posn. should get reparsed correctly with valid TSR +!!options +parsoid=wt2html,wt2wt +!!wikitext +{{echo|}}{| width = '100%' +|foo +|} +!!html/parsoid + + + + +
foo
+!!end + +!!test +2. Table tag in SOL posn. should get reparsed correctly with valid TSR +!!options +parsoid=wt2html,wt2wt +!!wikitext +a{| {{{b}}} +|c +|} +!!html/parsoid +{{{b}}} + +
c
+!!end + ### ### Testing parsing of templates where a template arg ### has the same name as the template itself. @@ -10361,7 +10610,7 @@ parsoid=wt2html,wt2wt,html2html
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -10372,7 +10621,7 @@ parsoid=wt2html,wt2wt,html2html
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -10383,7 +10632,7 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

+

!! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -18049,7 +18298,7 @@ Lead ### -### Parsoids-specific tests +### Parsoid-specific tests ### Parsoid-PHP parser incompatibilities ### !!test @@ -18072,6 +18321,35 @@ parsoid=wt2html,wt2wt !!end +#### ----------------------------------------------------------------- +#### Parsoid-specific functionality tests +#### ----------------------------------------------------------------- + +# Bug 63642: Formatting elt fixup is cleaned up. +# We know wt2wt will fail, but we expect selser to pass. +# Due to the nature of our testing, wt2wt and selser tests will enter the +# blacklist and we'll catch selser regressions based on changes to the +# blacklist entries for selser tests. +!! test +Bad treebuilder fixup of formatting elt is cleaned up +!! options +parsoid=wt2html,wt2wt +!! wikitext +{| +| + +[[Image:Foobar.jpg|right|Test]] + +|} +!! html/parsoid + + +
+

+
Test
+

+!! end + #### ---------------------------------------------------------------- #### Parsoid-only testing of Parsoid's impl of and #### tags. Parsoid's output for these tags differs from that of the @@ -18140,7 +18418,7 @@ A !! html -

A [1]

+

A [1]

  1. ↑ This is a bolded link and this is a transclusion @@ -18796,9 +19074,12 @@ Lists: 0. Outside nests *foo #foo + +;Foo:bar !! html

    *foo

    #foo +

    ;Foo:bar

    !!end @@ -19355,6 +19636,138 @@ parsoid [google !! end +!! test +Links 6. Add s between text-nodes and url-links when required (bug 64300) +!! html/parsoid +

    xhttp://example.comy +http://example.com?x +http://example.com&x +http://example.com'x +http://example.com,x +http://example.com.x +http://example.com;x +http://example.com:x +http://example.com;x +http://example.com!x +http://example.com=x +http://example.com(x) +http://example.com(x) +

    +!! wikitext +xhttp://example.comy +http://example.com?x +http://example.com&x +http://example.com'x +http://example.com,x +http://example.com.x +http://example.com;x +http://example.com:x +http://example.com;x +http://example.com!x +http://example.com=x +http://example.com(x) +http://example.com(x) +!! end + +!! test +Links 7a. Don't add spurious s between text-nodes and url-links (bug 64300) +!! html/parsoid +

    x +http://example.com +y +"http://example.com" +(http://example.com) +(http://example.com) foo +http://example.com, +http://example.com, foo +

    +!! wikitext +x +http://example.com +y +"http://example.com" +(http://example.com) +(http://example.com) foo +http://example.com, +http://example.com, foo +!! end + +## Parsoid currently fails wt2html on this one! +!! test +Links 7b. Don't add spurious s between text-nodes and url-links (bug 64300) +!! html/parsoid +

    http://example.com.,;:!?

    +!! wikitext +http://example.com.,;:!? +!! end + +!! test +Links 8. Add s between text-nodes and RFC-links when required (bug 64300) +!! html/parsoid +

    RFC 1234

    +!! wikitext +RFC 1234 +!! end + +!! test +Links 9. Don't add spurious s between text-nodes and RFC-links (bug 64300) +!! html/parsoid +

    xRFC 123y +XRFC 123y +RFC 123?foo +RFC 123&foo +

    +!! wikitext +xRFC 123y +XRFC 123y +RFC 123?foo +RFC 123&foo +!! end + +!! test +Links 10. Add s between text-nodes and PMID-links when required (bug 64300) +!! html/parsoid +

    PMID 1234 +!! wikitext +PMID 1234 +!! end + +!! test +Links 11. Don't add spurious s between text-nodes and PMID-links (bug 64300) +!! html/parsoid +

    xPMID 123y +XPMID 123y +PMID 123?foo +PMID 123&foo +

    +!! wikitext +xPMID 123y +XPMID 123y +PMID 123?foo +PMID 123&foo +!! end + +!! test +Links 12. Add s between text-nodes and ISBN-links when required (bug 64300) +!! html/parsoid +

    ISBN 12345678901 +ISBN 1234567890x +ISBN 1234567890b +

    +!! wikitext +ISBN 12345678901 +ISBN 1234567890x +ISBN 1234567890b +!! end + +!! test +Links 12. Don't add spurious s between text-nodes and ISBN-links (bug 64300) +!! html/parsoid +

    ISBN 1234567890's +!! wikitext +ISBN 1234567890's +!! end + #### --------------- Quotes --------------- #### 1. Quotes inside and #### 2. Link fragments separated by and tags @@ -20235,6 +20648,21 @@ parsoid=wt2html,wt2wt !!end +# Parsoid only for bug 64747 +!! test +Properly encapsulate empty-content transclusions in fosterable positions +!! wikitext + +{{#if:| + +}} +
    foo
    +!! html/parsoid + + +
    +!! end + !!test Support element with .data attribute !!options @@ -20436,7 +20864,7 @@ parsoid [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] !! html -
    caption
    caption
    caption
    +
    caption
    caption
    caption
    !!end !! test