From cd3ddb1f595e740fe3b7049c31e52876656fabef Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Wed, 2 Sep 2015 13:00:51 -0500 Subject: [PATCH] Sync up with Parsoid parserTests. This now aligns with Parsoid commit 5f2fae6c7e601b706403621924b769e87c5ed554 Change-Id: Ied3e5b2ac4df059c37f8e617ae55e47e8d15c1ee --- tests/parser/parserTests.txt | 366 ++++++++++++++++++++++++++--------- 1 file changed, 279 insertions(+), 87 deletions(-) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 8fe8c6159a..aa8c9c89c6 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -2057,13 +2057,28 @@ Tabs don't trigger preformatted text preformatted text. This is preformatted text. So is this. -!! html +!! html/php

This is not preformatted text.

This is preformatted text.
 	So is this.
 
+!! html/parsoid +

This is not + preformatted text.

+
This is preformatted text.
+	So is this.
+!! end + +!! test +Space before tab needs nowiki pre protection +!! options +parsoid=html2wt +!! html/parsoid +

a

+!! wikitext + a !! end !! test @@ -5234,38 +5249,6 @@ External link containing a single quote. (bug 63947)

bang

!! 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 double-single-quotes in text '' (bug 4598 sanity check) !! wikitext @@ -5301,9 +5284,22 @@ External link containing double-single-quotes with no space separating the url f External link with comments in link text !! wikitext [http://www.google.com Google ] -!! html +!! html/php

Google

+!! html/parsoid +

Google

+!! end + +!! test +External link to bare IPv4 address +!! wikitext +[http://192.168.0.1 Link] +!! html/php +

Link +

+!! html/parsoid +

Link

!! end !! test @@ -5345,7 +5341,7 @@ IPv6 urls, autolink format (T23261) !! wikitext http://[2404:130:0:1000::187:2]/index.php -Examples from RFC2373, section 2.2: +Examples from RFC 2373, section 2.2: * http://[1080::8:800:200C:417A]/unicast * http://[FF01::101]/multicast * http://[::1]/loopback @@ -5362,9 +5358,9 @@ Examples from RFC 2732, section 2: * http://[::FFFF:129.144.52.38]:80/index.html * http://[2010:836B:4179::836B:4179] -!! html +!! html/php

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

Examples from RFC2373, section 2.2: +

Examples from RFC 2373, section 2.2:

+!! html/parsoid +

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

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ !! end !! test @@ -5389,7 +5404,7 @@ IPv6 urls, bracketed format (T23261) !! wikitext [http://[2404:130:0:1000::187:2]/index.php test] -Examples from RFC2373, section 2.2: +Examples from RFC 2373, section 2.2: * [http://[1080::8:800:200C:417A] unicast] * [http://[FF01::101] multicast] * [http://[::1]/ loopback] @@ -5406,9 +5421,9 @@ Examples from RFC 2732, section 2: * [http://[::FFFF:129.144.52.38]:80/index.html 6] * [http://[2010:836B:4179::836B:4179] 7] -!! html +!! html/php

test -

Examples from RFC2373, section 2.2: +

Examples from RFC 2373, section 2.2:

+!! html/parsoid +

test

+ +

Examples from RFC 2373, section 2.2:

+ + +

Examples from RFC 2732, section 2:

+ !! end !! test @@ -5443,7 +5477,8 @@ Non-extlinks in brackets [{{echo|foo}}l's errand] [url={{echo|foo}}] [url=http://example.com] -!! html +[http:// bare protocols don't count] +!! html/php

[foo] [foo bar] [foo bar] @@ -5456,7 +5491,22 @@ Non-extlinks in brackets [fool's errand] [url=foo] [url=http://example.com] +[http:// bare protocols don't count]

+!! html/parsoid +

[foo] +[foo bar] +[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] +[http:// bare protocols don't count]

!! end !! test @@ -9874,27 +9924,33 @@ __proto__ Magic links: internal link to RFC (bug 479) !! wikitext [[RFC 123]] -!! html +!! html/php

RFC 123

+!! html/parsoid +

RFC 123

!! end !! test Magic links: RFC (bug 479) !! wikitext RFC 822 -!! html +!! html/php

RFC 822

+!! html/parsoid +

RFC 822

!! end !! test Magic links: RFC (bug 65278) !! wikitext This is RFC 822 but thisRFC 822 is not RFC 822linked. -!! html +!! html/php

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

+!! html/parsoid +

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

!! end !! test @@ -9903,20 +9959,26 @@ Magic links: RFC (w/ non-newline whitespace, bug 28950/29025) RFC       822 RFC 822 -!! html +!! html/php

RFC 822 RFC 822

+!! html/parsoid +

RFC       822 +RFC +822

!! end !! test Magic links: ISBN (bug 1937) !! wikitext ISBN 0-306-40615-2 -!! html +!! html/php

ISBN 0-306-40615-2

+!! html/parsoid +

ISBN 0-306-40615-2

!! end !! test @@ -9927,7 +9989,7 @@ This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

!! html/parsoid -

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

+

This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.

!! end !! test @@ -9938,31 +10000,41 @@ ISBN 9780316098113 ISBN 978 0316098113 -!! html +!! html/php

ISBN 978 0 316 09811 3 ISBN 9780316098113 ISBN 978 0316098113

+!! html/parsoid +

ISBN       978 0 316 09811 3 +ISBN +9780316098113 +ISBN 978 +0316098113

!! end !! test Magic links: PMID incorrectly converts space to underscore !! wikitext PMID 1234 -!! html +!! html/php

PMID 1234

+!! html/parsoid +

PMID 1234

!! end !! test Magic links: PMID (bug 65278) !! wikitext This is PMID 1234 but thisPMID 1234 is not PMID 1234linked. -!! html +!! html/php

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

+!! html/parsoid +

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

!! end !! test @@ -9971,11 +10043,15 @@ Magic links: PMID (w/ non-newline whitespace, bug 28950/29025) PMID       1234 PMID 1234 -!! html +!! html/php

PMID 1234 PMID 1234

+!! html/parsoid +

PMID       1234 +PMID +1234

!! end ### @@ -13264,7 +13340,7 @@ BUG 1887: A ISBN with a thumbnail
!! html/parsoid -
ISBN 1235467890
+
ISBN 1235467890
!! end !! test @@ -18234,7 +18310,7 @@ ISBN 978-0-1234-56 789 !! html+tidy

ISBN 978-0-1234-56 789

!! html/parsoid -

ISBN 978-0-1234-56 789

+

ISBN 978-0-1234-56 789

!! end !! test @@ -18254,7 +18330,7 @@ ISBN ISBN 1234567890

ISBN ISBN 1234567890

!! html/parsoid -

ISBN ISBN 1234567890

+

ISBN ISBN 1234567890

!! end # Uppercase X and lowercase x as well @@ -18276,12 +18352,12 @@ ISBN 978080442957x ISBN 978080442957x

!! html/parsoid -

ISBN 3-462-04561-X -ISBN 3-462-04561-x -ISBN 080442957X -ISBN 080442957x -ISBN 978080442957X -ISBN 978080442957x

+

ISBN 3-462-04561-X +ISBN 3-462-04561-x +ISBN 080442957X +ISBN 080442957x +ISBN 978080442957X +ISBN 978080442957x

!! end !! test @@ -18292,7 +18368,7 @@ ISBN 1234567890

ISBN 1234567890

!! html/parsoid -

ISBN 1234567890

+

ISBN 1234567890

!! end !! test @@ -18303,7 +18379,7 @@ Bug 22905: followed by ISBN followed by

(fr) ISBN 2753300917 example.com

!! html/parsoid -

(fr) ISBN 2753300917 example.com

+

(fr) ISBN 2753300917 example.com

!! end !! test @@ -22927,9 +23003,9 @@ PMID 123&foo !! test Links 12. Add s between text-nodes and ISBN-links when required (bug 64300) !! html/parsoid -

ISBN 12345678901 -ISBN 1234567890x -aISBN 1234567890b +

ISBN 12345678901 +ISBN 1234567890x +aISBN 1234567890b

!! wikitext ISBN 12345678901 @@ -22940,7 +23016,7 @@ aISBN 1234567890b !! test Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300) !! html/parsoid -

-ISBN 1234567890's +

-ISBN 1234567890's !! wikitext -ISBN 1234567890's !! html/php @@ -23123,38 +23199,58 @@ bar [[foo]] !! test 1. Leading whitespace in SOL context should be escaped !! options -parsoid +parsoid=html2wt,wt2wt +!! html/php +

a +

a +

a(tab) +

a + a +

a + b +

a + b +

a + b +

+!! html/parsoid +

a

+ +

a

+ +

a(tab)

+ +

a + + a

+ +

a + b

+ +

a + b

+ +

a + b

!! wikitext a a - a(tab) + a(tab) a - a + a a b a - b + b a - b -!! html -

a

-

a

-

a(tab)

-

a

-

a

-

a - b

-

a - b

-

a - b

+ b !! end !! test @@ -23456,7 +23552,7 @@ Table with broken attribute value quoting on consecutive lines !! end !! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) +2. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) !! options parsoid !! wikitext @@ -23466,7 +23562,7 @@ parsoid !! end !! test -Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) +1. Parsoid-only: Don't wrap broken template tags in on wt2wt (Bug 42353) !! options parsoid !! wikitext @@ -24515,7 +24611,7 @@ parsoid={ == [[Category:A2]] hi pal == -== [[Category:A3]] how goes it == +== [[Category:A3]] how goes it == == it goes well [[Category:A4]] == @@ -24967,7 +25063,7 @@ Edited ISBN links not serializable as ISBN links should serialize as wikilinks !! options parsoid=html2wt !! html/parsoid -ISBN 1234567895 +ISBN 1234567895 !! wikitext [[Special:BookSources/1234567890|ISBN 1234567895]] !! end @@ -25077,6 +25173,92 @@ parsoid=html2wt http://example.com http://example.com is not a link. !! end +!! test +Magic links inside links (not autolinked) +!! wikitext +[[Foo|http://example.com]] +[[Foo|RFC 1234]] +[[Foo|PMID 1234]] +[[Foo|ISBN 123456789x]] + +[http://foo.com http://example.com] +[http://foo.com RFC 1234] +[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

+!! html/parsoid +

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

+ +

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

+!! end + +!! test +Magic links inside image captions (autolinked) +!! wikitext +[[File:Foobar.jpg|thumb|http://example.com]] +[[File:Foobar.jpg|thumb|RFC 1234]] +[[File:Foobar.jpg|thumb|PMID 1234]] +[[File:Foobar.jpg|thumb|ISBN 123456789x]] +!! html+tidy +
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+!! html/parsoid +
http://example.com
+
RFC 1234
+
PMID 1234
+
ISBN 123456789x
+!! end + +!! test +WTS of magic word text (T109371) +!! options +parsoid=html2wt +!! html/parsoid +

RFC 1234

+

RFC 1234

+

RFC 1234

+!! wikitext +RFC 1234 + +[http://foo.com RFC 1234] + +[[Foo|RFC 1234]] +!! end + !! test Edited Redirect link should emit a non-piped wikitext link !! options @@ -25782,6 +25964,16 @@ parsoid={ !! end +!! test +Escape nowiki DOM elements +!! options +parsoid=html2wt +!! html/parsoid +foo +!! wikitext +<nowiki>''foo''</nowiki> +!! end + # --------------------------------------------------- # End of tests spec'ing wikitext serialization norms | # --------------------------------------------------- -- 2.20.1