X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=ffa435c08b55313e3ce23d1c27546b54e8a6ee5f;hb=c243573b5e8eebcd68d978d5d7a7e60b851b5a62;hp=2e1806da580df04adbc0fad0942b4b267ba930eb;hpb=0ea03a7f56070956838ab360a5dccc2a506fc4ff;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 2e1806da58..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
+
bar"}},"i":0}}]}'}'>foo|bar<div>
@@ -2793,18 +2818,20 @@ Templates: '=' char in nested transclusions should not trigger nowiki escapes or
parsoid=html2wt,wt2wt
!! wikitext
{{echo|{{echo|1=bar}}}}
-!! html
+!! html/php+tidy
+
bar
+!! html/parsoid
bar
!! end
## Bug 56733
!! test
Templates parameters with special tokenizing behavior dont get modified because of arg escaping
-!! options
-parsoid
!! wikitext
{{echo|a : b}}
-!! html
+!! html/php+tidy
+
!! end
@@ -2824,10 +2850,8 @@ Templates: Preserve blank parameter names
Templates: Preserve blank parameter names in other positions
!! wikitext
{{blank_param|bar|=foo}}
-!! html/php
-
bar
-foo
-
+!! html/php+tidy
+
bar foo
!! html/parsoid
bar
foo
@@ -3283,6 +3307,7 @@ parsoid=wt2html,wt2wt
!! wikitext
[[Category:foo]]
{{echo| [[Category:foo]]}}
+!! html/php+tidy
!! html/parsoid
@@ -3306,6 +3331,8 @@ Indent-Pre: Newlines in comments shouldn't affect sol state
a b
+!! html/php+tidy
+
a b
!! html/parsoid
a
!! endarticle
# hmm, fix this or just deprecate msgnw and document its behavior?
@@ -10336,6 +10386,7 @@ msgnw keyword
<gallery>
File:Foobar.jpg
</gallery>
+<!-- comment -->
!! end
@@ -10589,7 +10640,7 @@ b}}
!! end
!! test
-Parsoid: Merge double tds (bug 50603)
+Parsoid: Merge double tds (T52603)
!! options
parsoid
!! wikitext
@@ -10603,7 +10654,7 @@ parsoid
!! end
!! test
-Parsoid: Merge double tds in nested transclusion content (bug 50603)
+Parsoid: Merge double tds in nested transclusion content (T52603)
!! options
parsoid
!! wikitext
@@ -12146,7 +12197,7 @@ parsoid=wt2html
Parsoid: Escape nowiki with trailing space in tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
<noWikI > foo </NoWikI >
@@ -12603,6 +12654,21 @@ Image with link parameter, protocol-less URL target
!! end
+!! test
+Escaping non-block captions (T107435)
+!! options
+parsoid={
+ "modes": ["wt2wt"],
+ "changes": [
+ ["[typeof~='mw:Image']", "attr", "data-mw", "{\"caption\": \"|\"}"]
+ ]
+}
+!! wikitext
+[[Image:Foobar.jpg|caption]]
+!! wikitext/edited
+[[Image:Foobar.jpg||]]
+!! end
+
!! test
Image with link parameter, wgExternalLinkTarget
!! wikitext
@@ -12791,8 +12857,6 @@ parsoid=wt2html,wt2wt,html2html
!! test
Image with wiki markup in implicit alt
-!! options
-parsoid=wt2html,wt2wt,html2html
!! wikitext
[[Image:Foobar.jpg|testing '''bold''' in alt]]
@@ -12802,8 +12866,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -12884,7 +12948,7 @@ parsoid=wt2html,wt2wt,html2html
###################
# Image sizing.
# See https://www.mediawiki.org/wiki/Help:Images#Size_and_frame
-# and https://bugzilla.wikimedia.org/show_bug.cgi?id=62258
+# and https://phabricator.wikimedia.org/T64258
# Foobar has actual size of 1941x220
# 1. Thumbs & frameless always reduce, can't be enlarged unless it's
# a scalable format.
@@ -13041,7 +13105,7 @@ Frameless image caption with a free URL
!! html/parsoid
-
+
!! end
!! test
@@ -13117,7 +13181,7 @@ BUG 1887: A ISBN with a thumbnail
!! html/parsoid
-ISBN 1235467890
+ISBN 1235467890
!! end
!! test
@@ -13151,7 +13215,7 @@ BUG 648: Frameless image caption with a link
!! html/parsoid
-
+
!! end
!! test
@@ -13162,7 +13226,7 @@ BUG 648: Frameless image caption with a link (suffix)
!! html/parsoid
-
+
!! end
!! test
@@ -13173,7 +13237,7 @@ BUG 648: Frameless image caption with an interwiki link
!! html/parsoid
-
+
!! end
!! test
@@ -13184,7 +13248,15 @@ BUG 648: Frameless image caption with a piped interwiki link
!! html/parsoid
-
+
+!! end
+
+!! test
+T107474: Frameless image caption with
+!! wikitext
+[[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
+!! html/parsoid
+
!! end
!! test
@@ -13195,7 +13267,7 @@ Escape HTML special chars in image alt text
!! html/parsoid
-
+
!! end
!! test
@@ -13206,7 +13278,7 @@ BUG 499: Alt text should have Ӓ, not &1234;
!! html/parsoid
-
+
!! end
!! test
@@ -13533,7 +13605,7 @@ Parsoid-specific image handling - simple image with a formatted caption
!! wikitext
[[File:Foobar.jpg|
a
b
c
]]
!! html/parsoid
-
+
!! end
!! test
@@ -13986,7 +14058,7 @@ parsoid=wt2html
!! html/parsoid
This and this should be part of the same list item
-
So should this and this should be part of the same list item
+
So should this and this should be part of the same list item
!! end
@@ -14095,8 +14167,8 @@ parsoid
[[:Category:Foo|Bar]]
!! html
!! end
+# Uppercase X and lowercase x as well
!! test
ISBN with an X
!! wikitext
ISBN 3-462-04561-X
+ISBN 3-462-04561-x
ISBN 080442957X
+ISBN 080442957x
ISBN 978080442957X
+ISBN 978080442957x
!! html/php
!! end
@@ -20119,7 +20199,7 @@ Special characters in embedded file links (bug 27679)
!! html/parsoid
-
+
!! end
!! test
@@ -20891,7 +20971,7 @@ parsoid=wt2html,wt2wt
'''foo[[File:Foobar.jpg|thumb|caption]]bar'''
!! html/parsoid
foo
-caption
+caption
bar
!! end
@@ -20903,7 +20983,7 @@ parsoid=wt2html,wt2wt
'''[[Image:Foobar.jpg|right|300px]]'''
!! html/parsoid
-
+
!! end
@@ -21630,7 +21710,7 @@ parsoid
Headings: 1. Nested inside html
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
=foo=
=foo=
=foo=
@@ -21661,7 +21741,7 @@ parsoid=html2wt
Headings: 2. Outside heading nest on a single line
foo
*bar
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
*bar
foo
=bar
foo
=bar=
@@ -21719,7 +21799,7 @@ Headings: 4a. No escaping needed (testing just h1 and h2)
Headings: 4b. No escaping needed (inside p-tags)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
===
=foo= x
=foo=
@@ -22036,7 +22116,7 @@ Lists: 5. No unnecessary escapes
Lists: 6. Escape bullets in SOL position
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
*foo
!! wikitext
*foo
@@ -22057,7 +22137,7 @@ a
Lists: 8. Escape colons only if not present in tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
a:bc:d
!! wikitext
; a:b''c:d''
@@ -22433,7 +22513,7 @@ parsoid=wt2html
T97430: Don't emit empty nowiki pairs around marker meta tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
*This is a long sentence here that will make the nowiki algo split up the nowikis into multiple pairs
|** Make this another long long long sentence forcing the nowiki algo to split up the nowikis.
!! wikitext
-this is not a link: http://example.com
+this is not a link: http://example.com
!! end
!! test
@@ -22999,7 +23079,7 @@ parsoid
5. Nowiki escaping should account for indent-pres
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
==foo==
!! wikitext
==foo==
@@ -23025,7 +23105,7 @@ parsoid
1. Valid behavior switches should be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOC__
__TOC__
!! wikitext
@@ -23037,7 +23117,7 @@ __TOC__
2. Invalid behavior switches should not be escaped
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
__TOO__
__|__
!! wikitext
@@ -23872,7 +23952,7 @@ Don't block XML namespace declaration
Serialize interwiki links pointing to the current wiki as plain wiki links (bug 65869)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
[[Foo]]
@@ -23883,7 +23963,7 @@ parsoid=html2wt
New wikilinks should be serialized properly
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
FooFoo
!! wikitext
@@ -23895,7 +23975,7 @@ parsoid=html2wt
New wiki links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo_barFoo_bar
@@ -23911,7 +23991,7 @@ parsoid=html2wt
New wiki links (content string variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
Foo_barFoo bar./Foo_bar
@@ -23925,7 +24005,7 @@ parsoid=html2wt
New category links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -23940,7 +24020,7 @@ New sol transparent links don't need indent-pre nowiki protection
!! options
parsoid=html2wt
language=de
-!! html
+!! html/parsoid
@@ -23954,7 +24034,7 @@ language=de
New interlanguage links (href variations)
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -24101,16 +24181,17 @@ parsoid
bar
!! 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
@@ -24202,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
@@ -24214,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
@@ -24224,7 +24305,7 @@ parsoid=html2wt
Don't strip leading whitespace when handling indent-pre suppressing tags
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
@@ -24400,7 +24477,7 @@ parsoid={
Parsoid: Serialize positional parameters with = in them as named parameter
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo
@@ -24424,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}}
@@ -24434,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
@@ -24459,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]]
@@ -24469,7 +24546,7 @@ parsoid=html2wt
Enforce single-line context in the serializer
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
testing
123
@@ -24528,7 +24605,7 @@ ha
Serialize new placeholder space without spans
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
foo : bar
foo : bar
@@ -24551,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
@@ -24582,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
@@ -24608,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
@@ -24657,7 +24734,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
FootballFootballFootball
@@ -24674,7 +24751,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": true
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|''Football'']]
@@ -24687,7 +24764,7 @@ parsoid={
"modes": ["html2wt"],
"scrubWikitext": false
}
-!! html
+!! html/parsoid
Football
!! wikitext
[[Football|Foot]][[Football|ball]]
@@ -24701,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' ##
@@ -24741,7 +24818,7 @@ __NOCONTENTCONVERT__
Consecutive
s should not get merged
!! options
parsoid=html2wt,html2html
-!! html
+!! html/parsoid
a
b
c
@@ -24773,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]]
@@ -24783,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]
@@ -24793,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]
@@ -24874,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]]
@@ -24888,7 +24975,7 @@ parsoid=html2wt
T75121: Infer extension name from typeOf if data-mw is not present
!! options
parsoid=html2wt
-!! html
+!! html/parsoid
!! wikitext
@@ -24948,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
@@ -24964,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
@@ -24991,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]]
@@ -25005,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
@@ -25142,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
@@ -25190,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
@@ -25197,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
@@ -25213,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
-