From: C. Scott Ananian
Date: Mon, 17 Aug 2015 20:52:33 +0000 (-0400)
Subject: Sync up with Parsoid parserTests.
X-Git-Tag: 1.31.0-rc.0~10398
X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=59e8147b67f2d9b3d6db6132917b27ea2463e8aa;p=lhc%2Fweb%2Fwiklou.git
Sync up with Parsoid parserTests.
This now aligns with Parsoid commit 48617c40c2eb9c7a421bb9c5b3ba0907fdec9c21
Change-Id: I565886079e64985844fc0a7c67ab74340b42f84a
---
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 1d331dff50..ffa435c08b 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -838,15 +838,12 @@ parsoid=wt2html
!!end
# same html as previous, but wikitext adjusted to match parsoid html2wt
-# skipping wt2html and html2html because it wants to put before
!! test
Italics and bold: 5-quote opening sequence: (5,2+3)
-!! options
-parsoid=wt2wt,html2wt
!! wikitext
'''''foo'''''
-!! html
-
foo
+!! html/*
+
foo
!! end
@@ -1460,11 +1457,11 @@ Entities inside
!! test
Entities inside template parameters
-!! options
-parsoid
!! wikitext
{{echo|–}}
-!! html
+!! html/php+tidy
+
â
+!! html/parsoid
–
!! end
@@ -1472,7 +1469,7 @@ parsoid
Properly escape nowiki when combined with other wiki markup
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
* </nowiki> tag
!! wikitext
*</nowiki> tag
@@ -1482,7 +1479,7 @@ parsoid=html2wt
T93824: Put escaped HTML tags inside nowiki
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
<h2>foo</h2>
!! wikitext
foo
@@ -1492,7 +1489,7 @@ parsoid=html2wt
T71950: 1. Put nowiki as close to cause as possible, even with non-quote escapable chars
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
This text: L'Foo
This text: L''Foo
This text: L'''Foo''
@@ -1507,7 +1504,7 @@ This text: L'''[[Foo]]''
T71950: 2. Put nowiki as close to cause as possible, after ' :'
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -2016,7 +2017,7 @@ a [[Category:A1]] [[Category:A2]]
[[Category:A4]]
!! html/parsoid
a
-
+
!! end
!! test
@@ -2026,7 +2027,7 @@ parsoid=wt2html
!! wikitext
[[Category:A1]]a
!! html/parsoid
-
a
+
a
!! end
###
@@ -2343,13 +2344,17 @@ 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
-!!options
-parsoid
!! wikitext
foo
-!! html
+!! html/php+tidy
+
+foo
+
+!! html/parsoid
foo
!!end
@@ -2472,6 +2477,19 @@ Templates: Indent-Pre: 1f: Wrapping should be based on expanded content
!!end
+!! test
+Pres with newline attributes
+!! wikitext
+
hi
+!! html/php
+
hi
+
+!! html/parsoid
+
hi
+!! end
+
!! test
Things that look like
tags aren't treated as such
!! wikitext
@@ -2511,7 +2529,10 @@ Parsoid: handle pre with space after attribute
parsoid=wt2html
!! wikitext
{{echo|foo}}
-!! html
+!! html/php
+
{{echo|foo}}
+
+!! html/parsoid
{{echo|foo}}
!! end
@@ -2717,32 +2738,32 @@ Templates: Other wikitext in parameter names (bug 67657)
#--------------------------------------------------------------------
!! test
Templates: Parsoid parameter escaping test 1
-!! options
-parsoid
!! wikitext
{{echo|[foo]|{{echo|[bar]}}}}
-!! html
+!! html/php+tidy
+
[foo]
+!! html/parsoid
[foo]
!! end
!! test
Parsoid: Pipes in external links in template parameter
-!! options
-parsoid
!! wikitext
{{echo|[{{echo|http://example.com}} link]}}
-!! html
+!! html/php+tidy
+
@@ -2754,7 +2775,9 @@ Parsoid: Pipe in external link target and content in template parameter
parsoid=html2wt,wt2wt
!! wikitext
{{echo|[http://foo.com/a|b a|b]}}
-!! html
+!! html/php+tidy
+
!! wikitext
[[Foo]]
@@ -23885,7 +23963,7 @@ parsoid=html2wt
New wikilinks should be serialized properly
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
FooFoo
!! wikitext
@@ -23897,7 +23975,7 @@ parsoid=html2wt
New wiki links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo_barFoo_bar
@@ -23913,7 +23991,7 @@ parsoid=html2wt
New wiki links (content string variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo bar./Foo_bar
@@ -23927,7 +24005,7 @@ parsoid=html2wt
New category links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -23942,7 +24020,7 @@ New sol transparent links don't need indent-pre nowiki protection
!! options
parsoid=html2wt
language=de
-!! html
+!! html/parsoid
@@ -23956,7 +24034,7 @@ language=de
New interlanguage links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -24103,16 +24181,17 @@ parsoid
!! end
-#!! test
-#Image: new attributes should be serialized in wiki's language for RTL languages (bug 51852)
-#!! options
-#parsoid=html2wt
-#language=ar
-#!! html
-#
-#!! wikitext
-#[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]]
-#!! end
+!! test
+Image: new attributes should be serialized in wiki's language for RTL languages (bug 51852)
+!! options
+parsoid=html2wt
+language=ar
+disabled
+!! html/parsoid
+
+!! wikitext
+[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]]
+!! end
!! test
Image: Block level image should have \n before and after
@@ -24204,7 +24283,7 @@ parsoid=html2wt
Lists: Serialize correctly even when list content is wrapped in p-tags (like VE does)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
@@ -24216,7 +24295,7 @@ parsoid=html2wt
Lists: Serialize correctly even when list tags has unneeded whitespace between tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
!! wikitext
* foo
@@ -24226,7 +24305,7 @@ parsoid=html2wt
Don't strip leading whitespace when handling indent-pre suppressing tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -24402,7 +24477,7 @@ parsoid={
Parsoid: Serialize positional parameters with = in them as named parameter
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
@@ -24426,7 +24501,7 @@ data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},
Parsoid: Serialize positional parameters with = in extlink as named parameter
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
{{echo|1 = http://stuff?is=ok}}
@@ -24436,7 +24511,7 @@ parsoid=html2wt
Parsoid: Correctly serialize block-node children when they are a combination of text and p-nodes
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a
b
a
b
@@ -24461,7 +24536,7 @@ b
Substrings resembling wikitext in hrefs should not get nowiki escapes
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo''bar''baz
!! wikitext
[[Foo''bar''baz]]
@@ -24471,7 +24546,7 @@ parsoid=html2wt
Enforce single-line context in the serializer
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
testing
123
@@ -24530,7 +24605,7 @@ ha
Serialize new placeholder space without spans
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo : bar
foo : bar
@@ -24553,7 +24628,7 @@ foo : bar
1. I/B quote minimization: wikitext-only tags should be combined
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
AB
AB
@@ -24584,7 +24659,7 @@ parsoid=html2wt
2. I/B quote minimization: wikitext and html tags should not be combined
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
!! wikitext
@@ -24610,7 +24685,7 @@ parsoid=html2wt
4. I/B quote minimization: new content should be mimimized with adjacent old content
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
AB
AB
AB
@@ -24659,7 +24734,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
FootballFootballFootball
@@ -24676,7 +24751,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|''Football'']]
@@ -24689,7 +24764,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": false
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|Foot]][[Football|ball]]
@@ -24703,10 +24778,10 @@ parsoid={
Bug 54262: New entities
!! options
parsoid=html2wt
+!! html/parsoid
+
!! wikitext
-!! html
-
!! end
## Note that there is no wikitext output for 'unknownproperty' ##
@@ -24743,7 +24818,7 @@ __NOCONTENTCONVERT__
Consecutive
s should not get merged
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
a
b
c
@@ -24775,7 +24850,7 @@ f
Edited ISBN links not serializable as ISBN links should serialize as wikilinks
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
ISBN 1234567895
!! wikitext
[[Special:BookSources/1234567890|ISBN 1234567895]]
@@ -24785,7 +24860,7 @@ parsoid=html2wt
Edited RFC links not serializable as RFC links should serialize as extlinks
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
New RFC
!! wikitext
[//tools.ietf.org/html/rfc123 New RFC]
@@ -24795,7 +24870,7 @@ parsoid=html2wt
Edited PMID links not serializable as PMID links should serialize as extlinks
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
New PMID
!! wikitext
[//www.ncbi.nlm.nih.gov/pubmed/123?dopt=Abstract New PMID]
@@ -24876,11 +24951,21 @@ parsoid=html2wt
http://example.com is not a link.
!! end
+!! test
+WTS of autolink-like text after an autolink (T108563)
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! wikitext
+http://example.com http://example.com is not a link.
+!! end
+
!! test
Edited Redirect link should emit a non-piped wikitext link
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
#REDIRECT [[Bar]]
@@ -24890,7 +24975,7 @@ parsoid=html2wt
T75121: Infer extension name from typeOf if data-mw is not present
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
@@ -24950,7 +25035,7 @@ parsoid=html2wt,wt2wt
HTML id attribute with Parsoid-like element ids should not be serialized to wikitext
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
bar
@@ -24966,7 +25051,7 @@ parsoid=html2wt
Parsoid-like element ids should not be serialized to wikitext unless shadowed
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
ok
!! wikitext
ok
@@ -24993,7 +25078,7 @@ parsoid={
Never serialize a-tag as html, regardless of what data-parsoid has to say
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo
!! wikitext
[[Foo]]
@@ -25007,12 +25092,25 @@ parsoid=html2wt
Never serialize a-tag as html, no matter what attributes it has
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
[http://boo.org http://boohoo.org]
!! end
+# Misnested is an indication that selser can reuse the source but these have
+# shown to sneak through on occasion. See T101768.
+# The original wikitext here is: [http://test.com [[one]] two three]
+!! test
+Strip span tags added to mark as misnested
+!! options
+parsoid=html2wt
+!! html/parsoid
+
"]
+ ]
+}
+!! wikitext
+foo
+!! wikitext/edited
+foo
+
+x
+!! end
+
+!! test
+1. Indent Pre Nowiki: suppress whitespace at the start of new paragraph
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": true
+}
+!! html/parsoid
hi
hello
!! wikitext
@@ -25144,7 +25384,7 @@ hello
2. Indent Pre Nowiki: don't suppress whitespace at the start of new paragraph if scrubWikitext is false
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
hi
hello
!! wikitext
@@ -25192,6 +25432,23 @@ foo
barboo
!! end
+!! test
+4. Indent Pre Nowiki: suppress leading whitespace in edited paragraphs
+!! options
+parsoid={
+ "modes": ["selser"],
+ "scrubWikitext": true,
+ "changes": [
+ [ "p", "html", " a\n b" ]
+ ]
+}
+!! wikitext
+xyz
+!! wikitext/edited
+a
+b
+!! end
+
!! test
1. New links that end in spaces
!! options
@@ -25199,13 +25456,16 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": false
}
-!! html
+!! html/parsoid
!! wikitext
[[Berlin ]]is the capital of Germany.
[[Foo ]]'''bar'''
+
+[[Boston ]] is a city.
!! end
!! test
@@ -25215,30 +25475,195 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
!! wikitext
[[Berlin]] is the capital of Germany.
[[Foo]] '''bar'''
+
+[[Boston]] is a city.
+!! end
+
+!! test
+1. Table cells with escapable prefixes
+!! options
+parsoid={
+ "modes": ["html2wt"],
+ "scrubWikitext": false
+}
+!! html
+
+
a
+
-
+
+
+
+!! wikitext
+{|
+|a
+|-
+|-
+|-
+|+
+|}
!! end
!! test
-3. Existing links that end in spaces
+2. Table cells with escapable prefixes
!! options
parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
!! html
-