From 7b56518d5153c458388bc015193754174448b327 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian"
Date: Wed, 28 Jan 2015 15:49:10 -0800
Subject: [PATCH] Sync up with Parsoid parserTests.
This now aligns with Parsoid commit 88605a4a7a37a61da76238db6d3fff756e8514f1
Change-Id: Ia6d103bec95019eaece64166172a166f8eabdd09
---
tests/parser/parserTests.txt | 1028 ++++++++++++++++++++++------------
1 file changed, 674 insertions(+), 354 deletions(-)
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 7eb152ab8e..18aeabb540 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -111,12 +111,6 @@ Template:echo_with_div
{{{1}}}
!! endarticle
-!! article
-Template:attr_str
-!! text
-{{{1}}}="{{{2}}}"
-!! endarticle
-
!! article
Template:table_attribs
!! text
@@ -137,6 +131,15 @@ Template:image_attribs
[[File:foobar.jpg|right|Caption text]]
!! endarticle
+## See T48811 for details
+!! article
+Template:mixed_attr_content_template
+!! text
+style="color:red;" title="T48811"
+|-
+|foo
+!! endarticle
+
!! article
A?b
!! text
@@ -706,7 +709,7 @@ parsoid=wt2html
!! test
Italics and bold: 4-quote opening sequence: (4,4) w/ nowiki
!! wikitext
-''''foo''''
+''''foo''''
!! html
'foo'
@@ -1322,10 +1325,10 @@ parsoid
Properly escape nowiki when combined with other wiki markup
!! options
parsoid=html2wt
-!! wikitext
-* </nowiki> tag
!! html
* </nowiki> tag
+!! wikitext
+* </nowiki> tag
!! end
###
@@ -2519,6 +2522,18 @@ parsoid
a : b
!! end
+## Bug T73412
+!! test
+Templates: Preserve blank parameter names
+!! wikitext
+{{echo|=foo}}
+!! html/php
+
{{{1}}}
+
+!! html/parsoid
+
{{{1}}}
+!! end
+
###
### Parsoid-centric tests for testing RT edge cases for pre
###
@@ -3201,10 +3216,12 @@ Definition list with wikilink containing colon
Definition list with news link containing colon
!! wikitext
; news:alt.wikipedia.rox: This isn't even a real newsgroup!
-!! html
+!! html/php
+!! end
!! test
BUG 289: ">"-token in bracketed URL
@@ -5971,6 +6009,11 @@ parsoid=wt2html,wt2wt
Parsoid: Default to a newline after tables in new content (bug 51219)
!! options
parsoid=html2wt
+!! html
+
quux
!! end
!! test
Parsoid: newline inducing block nodes don't suppress
!! options
parsoid=html2wt
+!! html
+ a
foo
!! wikitext
a
= foo =
-!! html
- a
foo
!! end
!! test
@@ -6231,9 +6269,11 @@ Bug 43661: Piped links with identical prefixes
Link with HTML entity in suffix / tail
!! wikitext
[[Main Page]]", [[Main Page]]a
-!! html
+!! html/php
!! end
!! test
@@ -6268,10 +6308,13 @@ Piped link with extlink-like text
!! wikitext
[[Main Page|[bar]]]
[[Main Page|This is a [bar]]]
-!! html
+!! html/php
!! end
!! test
@@ -6336,11 +6379,10 @@ Namespace takes precedence over interwiki link (bug 51680)
Link to namespace preferred over interwiki with correct rel attribute
!! options
parsoid=html2wt,html2html
+!! html
+
!! end
!! test
@@ -7498,11 +7540,11 @@ language=is
New redirect
!! options
parsoid=html2wt
+!! html
+
Foo
!! wikitext
Foo
#REDIRECT [[Foo]]
-!! html
-
Foo
!! end
##
@@ -8875,10 +8917,10 @@ hi+world%3F%21
Magic Word: prioritize type info over data-parsoid
!! options
parsoid=html2wt
-!! wikitext
-__FORCETOC__
!! html
+!! wikitext
+__FORCETOC__
!! end
!! test
@@ -8960,9 +9002,11 @@ ISBN 0-306-40615-2
Magic links: ISBN (bug 65278)
!! wikitext
This is ISBN 978-0-316-09811-3 but thisISBN 978-0-316-09811-3 is not ISBN 978-0-316-09811-3linked.
-!! html
+!! html/php
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.
!! end
!! test
@@ -9309,15 +9353,6 @@ Template parameter as link source
!! end
-!!test
-Template-generated attribute string (k='v')
-!! wikitext
-bar
-!! html
-
bar
-
-!!end
-
!!article
Template:paramtest2
!! text
@@ -10160,6 +10195,9 @@ Templates: HTML Tag: 6. Generation of end piece of HTML attr value
!!end
+# SSS FIXME: While it is great we added support for all this,
+# do we want to make this part of the spec? Maybe we want to
+# deprecate this kind of usage in the future?
!!test
Templates: HTML Tag: 7. Generation of partial attribute key string
!! wikitext
@@ -10169,6 +10207,50 @@ Templates: HTML Tag: 7. Generation of partial attribute key string
!!end
+!! test
+Templates: HTML Tag: 8. Template-generated attribute (k=v)
+!! wikitext
+
bar
+!! html
+
bar
+
+!!end
+
+!! test
+Templates: HTML Tag: 9. Multiple template-generated attributes
+!! wikitext
+
bar
+!! html
+
bar
+
+!!end
+
+!! test
+Templates: Support for templates generating attributes and content
+!! wikitext
+{| {{mixed_attr_content_template}}
+|-
+|bar
+|}
+!! html/php
+
+
+
+
foo
+
+
+
bar
+
+
+!! html/parsoid
+
+
+
foo
+
+
bar
+
+!!end
+
!!test
Templates: HTML Tables: 1. Generating start of a HTML table
!! wikitext
@@ -11142,26 +11224,26 @@ parsoid=wt2html
Parsoid: Escape nowiki with trailing space in tags
!! options
parsoid=html2wt
+!! html
+
!! end
!! test
Parsoid: Escape weird noWikI capitalizations
!! options
parsoid=html2wt
-!! wikitext
-<noWikI > foo </NoWikI >
!! html
<noWikI > foo </NoWikI >
+!! wikitext
+<noWikI > foo </NoWikI >
!! end
###
@@ -11389,6 +11471,17 @@ Link with empty target
!! end
+!! test
+Image with link trail
+!! wikitext
+Linktrails should not work for images: [[File:Foobar.jpg]]s
+!! html/php
+
Linktrails should not work for images: s
+
+!! html/parsoid
+
Linktrails should not work for images: s
+!! end
+
!! test
Image with empty attribute
!! options
@@ -13351,10 +13444,12 @@ __TOC__
!! test
BUG 1219 URL next to image (good)
!! wikitext
-http://example.com [[Image:foobar.jpg]]
-!! html
+http://example.com [[File:Foobar.jpg]]
+!! html/php
!!end
!! test
@@ -13577,10 +13672,12 @@ c3-->
!! test
BUG 1219 URL next to image (broken)
!! wikitext
-http://example.com[[Image:foobar.jpg]]
-!! html
+http://example.com[[File:Foobar.jpg]]
+!! html/php
!! end
@@ -16833,9 +16951,11 @@ ISBN 1234567890
Bug 22905: followed by ISBN followed by
!! wikitext
(fr) ISBN 2753300917 [http://www.example.com example.com]
-!! html
+!! html/php
!!end
# NOTE: constructor is a predefined property in JS and constructor as a ref-name can clash with it if not handled properly)
@@ -19504,7 +19624,7 @@ parsoid
!! wikitext
A foo
!! html
-
-!! end
+!!end
!! test
Headings: 4b. No escaping needed (inside p-tags)
!! options
parsoid=html2wt
-!! wikitext
-===
-=foo= x
-=foo=
!! html
===
=foo= x
=foo=
+!! wikitext
+===
+=foo= x
+=foo=
!!end
!! test
@@ -20233,13 +20376,31 @@ parsoid
Headings: 6d. Heading chars in SOL context (No escaping needed)
!! options
parsoid=html2wt
-!! wikitext
-=a=
b
!! html
=a=
b
+!! wikitext
+=a=
b
!!end
-#### --------------- Lists ---------------
+!! test
+Headings: 7. Insert a newline between new content and headings
+!! options
+parsoid=html2wt
+!! html
+
NEW
+
new
+
A
+
a
+!! wikitext
+== NEW ==
+new
+
+==A==
+a
+
+!! end
+
+#### --------------- Lists ---------------
#### 0. Outside nests (*foo, etc.)
#### 1. Nested inside html
*foo
#### 2. Inside definition lists
@@ -20389,10 +20550,10 @@ Lists: 5. No unnecessary escapes
Lists: 6. Escape bullets in SOL position
!! options
parsoid=html2wt
-!! wikitext
-*foo
!! html
*foo
+!! wikitext
+*foo
!!end
!! test
@@ -20410,10 +20571,10 @@ a
Lists: 8. Escape colons only if not present in tags
!! options
parsoid=html2wt
-!! wikitext
-; a:b''c:d''
!! html
!! 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
-
!! wikitext
ISBN 12345678901
ISBN 1234567890x
-ISBN 1234567890b
+aISBN 1234567890b
!! end
!! test
-Links 12. Don't add spurious s between text-nodes and ISBN-links (bug 64300)
+Links 13. Don't add spurious s between text-nodes and ISBN-links (bug 64300)
!! html/parsoid
-
!! end
!! test
-1b. Quotes inside and with other chars
+1b. Quotes inside and with other tags on same line
!! options
parsoid=html2wt,wt2wt
!! wikitext
@@ -21078,11 +21309,17 @@ parsoid=html2wt,wt2wt
''a''' foo ''[[bar]]''
''a''' foo '''{{echo|[[bar]]}}'''
[[foo]] x'''[[bar]]''
+'''foo'' test
+'''foo''
test
+'''foo'' and bar
!! html
'a foo bara' foo bara' foo barfoo x'bar
+'foo[1]
+'foo
test
+'foo and bar
!! end
!! test
@@ -21197,7 +21434,7 @@ parsoid
foo ''a''
b
!! html
-
!! end
!! test
@@ -21245,22 +21482,22 @@ parsoid=html2wt
1. Valid behavior switches should be escaped
!! options
parsoid=html2wt
-!! wikitext
-__TOC__
-''__TOC__''
!! html
__TOC__
__TOC__
+!! wikitext
+__TOC__
+''__TOC__''
!! end
!! test
2. Invalid behavior switches should not be escaped
!! options
parsoid=html2wt
-!! wikitext
+!! html
__TOO__
__|__
-!! html
+!! wikitext
__TOO__
__|__
!! end
@@ -21634,6 +21871,29 @@ Indented table with an empty td
!!end
+## We have some newline diffs RT-ing this edge case
+## and it is not important enough -- we seem to be emitting
+## at most 2 newlines after a and this is unrelated to
+## the issue from T85627 that this is testing.
+!!test
+Indented table with blank lines in between (T85627)
+!! options
+parsoid=wt2html
+!! wikitext
+ {|
+ |foo
+
+
+ |}
+!! html
+
+
+
+
foo
+
+
+!!end
+
!!test
Indented block & table
!! wikitext
@@ -21733,6 +21993,10 @@ Multi-line image caption generated by templates with/without trailing newlines
New element inserted (without intervening newlines) after an old sol-transparent node should serialize correctly
!! options
parsoid=html2wt
+!! html
+
new para
+
+
new heading
!! wikitext
foo
new para
@@ -21740,10 +22004,6 @@ new para
[[./Category:Foo]]
= new heading =
-!! html
-
new para
-
-
new heading
!! end
## PHP emits broken html for this, and since this is primarily
@@ -22024,10 +22284,10 @@ Properly encapsulate empty-content transclusions in fosterable positions
Support