X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=72ee550109ace80421838d2ffe2e96eb4086547a;hb=fd3773685b887dc2b4fa856907a9cf5229df74ac;hp=d47637345d9d961d01f156223f7668206758d1fc;hpb=1e6931aebe91886cf5ca155bfdc57efbf2aa7d17;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index d47637345d..72ee550109 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -546,15 +546,19 @@ Extra newlines between heading and content are swallowed
Heading with line break in nowiki
!! options
parsoid=wt2html
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
== A B
C ==
-!! html
-
!! end
+!! test
+No p-wrappable content
+!! wikitext
+
x
+
x
+
x
+!! html+tidy
+
x
+
x
+
x
+!! html/parsoid
+
x
+
x
+
x
+!! end
+
+# T177612: Parsoid-only test
+!! test
+Transclusion meta tags shouldn't trip Parsoid's useless p-wrapper stripping code
+!! wikitext
+{{echo|
x
}}
+x
+!! html/parsoid
+
x
+
x
+!! end
+
!! test
Block tag on one line (
)
!! wikitext
@@ -4338,12 +4369,12 @@ Definition Lists: Mixed Lists: Test 10
!! test
Definition Lists: Mixed Lists: Test 11
!! wikitext
-;a
-:*b
-!! html
-
a
+; a
+:* b
+!! html/*
+
a
-
b
+
b
!! end
@@ -4806,8 +4837,11 @@ foo//example.com/Foo
!! end
+## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
!! test
External links: with no contents
+!! options
+parsoid=wt2html,wt2wt
!! wikitext
[http://en.wikipedia.org/wiki/Foo]
@@ -4821,8 +4855,8 @@ External links: with no contents
!! html/parsoid
!! end
## We don't support roundtripping of these attributes in Parsoid.
@@ -7795,13 +7829,15 @@ Link with multiple pipes
!! test
Anchor containing a #. (T65430)
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
[[Main Page#And#Link]]
!! html/php
-
!! end
!! test
@@ -7919,13 +7955,27 @@ Link containing % as a double hex sequence interpreted to hex sequence
## Example for such a section: == < ==
!! test
Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
[[%23%3c]][[%23%3e]]
!! html/php
-
+!! end
+
+## Example for such a section: == < ==
+!! test
+Link containing "#<" and "#>" % as a hex sequences- these are valid section anchors (legacy)
+!! config
+wgFragmentMode=[ 'legacy' ]
+!! wikitext
+[[%23%3c]][[%23%3e]]
+!! html/php
+
!! end
!! test
@@ -7995,7 +8045,7 @@ File containing double quotes and spaces
!! wikitext
[[File:Cool "Gator".png]]
!! html/parsoid
-
+
!! end
!! test
@@ -8038,12 +8088,12 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
[[''Pentecoste''|''Pentecoste'']]
!! html/php
+!! wikitext
+[[Test]]
+
+[[[Test]]]
+
+[[[[Test]]]]
+
+[[[[[Test]]]]]
+
+[[[[[[Test]]]]]]
+
+[[[[[[[Test]]]]]]]
+!! end
+
!! test
Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
!! wikitext
@@ -8545,13 +8620,26 @@ Parsoid: Scoped parsing should handle mixed transclusions and plain text
!! test
Link with angle bracket after anchor
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
[[Foo#]]
!! html/php
-
!! end
+## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
!! test
Interwiki link encoding conversion (T3636)
+!! options
+parsoid=wt2html,wt2wt
!! wikitext
*[[Wikipedia:ro:Olteniţa]]
*[[Wikipedia:ro:Olteniţa]]
@@ -8598,6 +8689,11 @@ Interwiki link encoding conversion (T3636)
!! end
!! test
@@ -8611,6 +8707,27 @@ Interwiki link with fragment (T4130)
!! test
Link scenarios with escaped fragments
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
+!! wikitext
+[[#Is this great?]]
+[[Foo#Is this great?]]
+[[meatball:Foo#Is this great?]]
+!! html/php
+
+!! end
+
+!! test
+Link scenarios with escaped fragments (legacy)
+!! config
+wgFragmentMode=[ 'legacy' ]
!! wikitext
[[#Is this great?]]
[[Foo#Is this great?]]
@@ -8620,10 +8737,6 @@ Link scenarios with escaped fragments
Foo#Is this great?meatball:Foo#Is this great?
-!! html/parsoid
-
!! end
# Ideally the wikipedia: prefix here should be proto-relative too
@@ -8648,19 +8761,19 @@ Different interwiki prefixes mapping to the same URL
[[ wikiPEdia :Foo]]
!! html/parsoid
-
+local:es:Spanish
!! end
!! test
@@ -9114,10 +9227,12 @@ Blah blah blah
# This tests the Parsoid bail-out code.
!! test
3. Other redirect variants
+!! options
+parsoid=wt2html
!! wikitext
#REDIRECT [[[[Bar]]]]
!! html/parsoid
-
REDIRECT [[[[Bar]]]]
+
REDIRECT [[[[Bar]]]]
!! end
!! test
@@ -9411,7 +9526,7 @@ Handling html with a div self-closing tag
!! html/parsoid
-
+
@@ -10935,10 +11050,10 @@ Magic links: RFC (T2479)
!! wikitext
RFC 822
!! html/php
-
!! end
!! test
@@ -11324,6 +11439,15 @@ Templates with templated name
item 1
!! end
+## Regression test; the output here isn't really that interesting.
+!! test
+Templates with templated name and top level template args
+!! wikitext
+{{1{{2{{{3}}}|4=5}}}}
+!! html/parsoid
+
{{1{{2{{{3}}}|4=5}}}}
+!! end
+
# Parsoid markup is deliberate "broken". This is an edge case.
# See long comment in TemplateHandler.js:convertAttribsToString.
!! test
@@ -11420,9 +11544,9 @@ Abort table cell attribute parsing on wikilink
!! html/parsoid
!! end
@@ -12448,6 +12572,8 @@ Preprocessor precedence 14: broken language converter in comment
!! test
Preprocessor precedence 15: broken brace markup in headings
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! options
parsoid=wt2html
!! wikitext
@@ -12465,32 +12591,31 @@ __NOTOC__ __NOEDITSECTION__
===6 foo-{bar 6===
6
!! html/php+tidy
-
1 foo[bar 1
+
1 foo[bar 1
1
-
2 foo[[bar 2
+
2 foo[[bar 2
2
-
3 foo{bar 3
+
3 foo{bar 3
3
-
4 foo{{bar 4
+
4 foo{{bar 4
4
-
5 foo{{{bar 5
+
5 foo{{{bar 5
5
-
6 foo-{bar 6
+
6 foo-{bar 6
6
!! html/parsoid
-
-
1 foo[bar 1
+
+
1 foo[bar 1
1
-
2 foo[[bar 2
+
2 foo[[bar 2
2
-
3 foo{bar 3
+
3 foo{bar 3
3
-
4 foo{{bar 4
+
4 foo{{bar 4
4
-
5 foo{{{bar 5
+
5 foo{{{bar 5
5
-
6 foo-{bar 6
+
6 foo-{bar 6
6
!! end
@@ -14192,15 +14317,15 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
-Serialize simple image with figure-inline wrapper
+Serialize simple image with span wrapper
!! options
parsoid=html2wt
!! html/parsoid
-
+
!! wikitext
[[File:Foobar.jpg]]
!! end
@@ -14213,7 +14338,7 @@ Simple image (using File: namespace, now canonical)
!! html/parsoid
-
+
!! end
!! test
@@ -14330,7 +14455,7 @@ Linktrails should not work for images: [[File:Foobar.jpg]]s
Linktrails should not work for images: s
!! html/parsoid
-
Linktrails should not work for images: s
+
Linktrails should not work for images: s
!! end
!! test
@@ -14376,7 +14501,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
## Parsoid does not provide editing support for images where templates produce multiple image attributes.
@@ -14420,7 +14545,7 @@ thumbsize=220
456
!! html/parsoid
-
123456
+
123456
123
456
123
456
!! end
@@ -14444,7 +14569,7 @@ Image with multiple widths -- use last
!! html/parsoid
-
+
!! end
!! test
@@ -14461,7 +14586,7 @@ thumbsize=220
!! html/parsoid
caption
-
+
!! end
!! test
@@ -14494,7 +14619,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
@@ -14505,7 +14630,7 @@ Image with link parameter, wiki target
!! html/parsoid
-
+
!! end
# parsoid T51293 (part 1)
@@ -14517,7 +14642,7 @@ Image with link parameter, URL target
!! html/parsoid
-
+
!! end
# parsoid T51293 (part 2)
@@ -14529,7 +14654,7 @@ Image with link parameter, protocol-less URL target
!! html/parsoid
-
+
!! end
!! test
@@ -14601,7 +14726,7 @@ Image with empty link parameter
!! html/parsoid
-
+
!! end
!! test
@@ -14612,7 +14737,7 @@ Image with link parameter (wiki target) and unnamed parameter
!! html/parsoid
-
+
!! end
!! test
@@ -14623,7 +14748,7 @@ Image with link parameter (URL target) and unnamed parameter
!! html/parsoid
-
+
!! end
!! test
@@ -14746,9 +14871,9 @@ Image with wiki markup in implicit alt
!! html/parsoid
-
+
-
+
!! end
!! test
@@ -14759,7 +14884,65 @@ Alt image option should handle most kinds of wikitext without barfing
This is the image caption
!! html/parsoid
-This is the image caption
+This is the image caption
+!! end
+
+!! test
+Image with table with attributes in caption
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+[[File:Foobar.jpg|thumb|
+{| class="123" |
+|- class="456" |
+| ha
+|}
+]]
+!! html/parsoid
+
+
+
+
ha
+
+
+!! end
+
+!! test
+Image with table with rows from templates in caption
+!! wikitext
+[[File:Foobar.jpg|thumb|
+{|
+{{echo|{{!}} hi}}
+|}
+]]
+!! html/parsoid
+
+
+
hi
+
+
+!! end
+
+!! test
+Image with nested tables in caption
+!! wikitext
+[[File:Foobar.jpg|thumb|Foo
+{|
+|
+{|
+|z
+|}
+|}
+]]
+!! html/parsoid
+
Foo
+
+
+
+
z
+
+
+
!! end
###################
@@ -14783,9 +14966,9 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
-
+
+
+
!! end
!! test
@@ -14850,8 +15033,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14867,8 +15050,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14911,7 +15094,7 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
+
!! end
!! test
@@ -14927,8 +15110,8 @@ parsoid=wt2html,wt2wt,html2html
!! html/parsoid
-
-
+
+
!! end
!! test
@@ -14986,7 +15169,7 @@ Frameless image caption with a free URL
!! html/parsoid
-
+
!! end
!! test
@@ -15046,12 +15229,12 @@ SVG thumbnails with invalid language code
!! options
parsoid=wt2html,wt2wt,html2html
!! wikitext
-[[File:Foobar.svg|thumb|caption|lang=invalid.language.code]]
+[[File:Foobar.svg|thumb|caption|lang=invalid:language:code]]
!! html/php
-
lang=invalid.language.code
+
lang=invalid:language:code
!! html/parsoid
-lang=invalid.language.code
+lang=invalid:language:code
!! end
!! test
@@ -15070,10 +15253,10 @@ T3887: A RFC with a thumbnail
!! wikitext
[[File:Foobar.jpg|thumb|This is RFC 12354]]
!! html/php
-
!! html/parsoid
-This is RFC 12354
+This is RFC 12354
!! end
!! test
@@ -15096,7 +15279,7 @@ T2648: Frameless image caption with a link
!! html/parsoid
-
+
!! end
!! test
@@ -15107,7 +15290,7 @@ T2648: Frameless image caption with a link (suffix)
!! html/parsoid
-
+
!! end
!! test
@@ -15118,7 +15301,7 @@ T2648: Frameless image caption with an interwiki link
!! html/parsoid
-
+
!! end
!! test
@@ -15129,7 +15312,7 @@ T2648: Frameless image caption with a piped interwiki link
!! html/parsoid
-
+
!! end
!! test
@@ -15137,7 +15320,7 @@ T107474: Frameless image caption with
!! wikitext
[[File:Foobar.jpg|text with a [[MeatBall:Link|link]] in it]]
!! html/parsoid
-
+
!! end
!! test
@@ -15148,7 +15331,7 @@ Escape HTML special chars in image alt text
!! html/parsoid
-
+
!! end
!! test
@@ -15161,7 +15344,7 @@ language=zh
!! html/parsoid
-
+
!! end
!! test
@@ -15172,7 +15355,7 @@ Entities in file name and attributes
!! end
!! test
@@ -15183,7 +15366,7 @@ T2499: Alt text should have Ӓ, not &1234;
!! html/parsoid
-
+
!! end
!! test
@@ -15207,7 +15390,7 @@ Image caption containing another image
This is a caption with another inside it!
!! html/parsoid
-This is a caption with another inside it!
+This is a caption with another inside it!
!! end
!! test
@@ -15219,7 +15402,7 @@ Image: caption containing a newline
!! end
# Parsoid-specific testing for images
@@ -15402,7 +15585,7 @@ Parsoid-specific image handling - simple image with size and middle alignment
!! wikitext
[[File:Foobar.jpg|middle|50px]]
!! html/parsoid
-
+
!! end
!! test
@@ -15413,7 +15596,7 @@ parsoid=wt2wt,wt2html,html2html
!! wikitext
[[Image:Foobar.jpg|middle|50px]]
!! html/parsoid
-
+
!! end
!! test
@@ -15422,7 +15605,7 @@ Parsoid-specific image handling - simple image with size and middle alignment
!! wikitext
[[File:Foobar.jpg|50px|middle]]
!! html/parsoid
-
+
!! end
!! test
@@ -15433,7 +15616,7 @@ parsoid=wt2html,wt2wt,html2html
!! wikitext
[[Image:Foobar.jpg|50px|middle]]
!! html/parsoid
-
+
!! end
!! test
@@ -15441,7 +15624,7 @@ Parsoid-specific image handling - simple image with both sizes, a baseline align
!! wikitext
[[File:Foobar.jpg|500x10px|baseline|caption]]
!! html/parsoid
-
+
!! end
!! test
@@ -15449,7 +15632,7 @@ Parsoid-specific image handling - simple image with border and size spec
!! wikitext
[[File:Foobar.jpg|50px|border|caption]]
!! html/parsoid
-
+
!! end
!! test
@@ -15513,7 +15696,7 @@ Parsoid-specific image handling - frameless image with specific size, border, an
!! wikitext
[[File:Foobar.jpg|frameless|442x50px|border|caption]]
!! html/parsoid
-
+
!! end
!! test
@@ -15521,7 +15704,7 @@ Parsoid-specific image handling - simple image with a formatted caption
!! wikitext
[[File:Foobar.jpg|
a
b
c
]]
!! html/parsoid
-
+
!! end
!! test
@@ -15591,7 +15774,7 @@ foo
bar
!! html/parsoid
!! end
@@ -16142,6 +16325,68 @@ parsoid=wt2html
!! end
+!! test
+9. Categories and newlines: should behave properly with linkprefix (T87753)
+!! options
+language=ar
+!! wikitext
+foo bar
+foo bar
+[[تصÙÙÙ:Foo]]
+[[تصÙÙÙ:Bar]]
+!! html/php
+
foo bar
+foo bar
+
+!! html/parsoid
+
foo bar
+foo bar
+
+
+!! end
+
+!! test
+10. No regressions on internal links following category (T174639)
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+[[Category:Foo]]
+!! end
+
+# Note that Parsoid differs slightly from PHP due to T175421
+!! test
+11. Special case where only newlines separate links (T175416)
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+[[Category:Foo]]
+
+[[Foo]][[es:Alimento]]
+
+[[Foo]]
+!! html/php
+
+!! end
+
!! test
Category links with multiple namespaces
!! wikitext
@@ -16189,6 +16434,20 @@ x[[Category:Foo]]y
xy
!! end
+!! test
+Link prefix/suffixes aren't applied to language links
+!! options
+parsoid=wt2html
+language=is
+!! wikitext
+x[[es:Foo]]y
+!! html/php
+
xy
+
+!! html/parsoid
+
xy
+!! end
+
!! test
Parsoid: Serialize link to file page with colon escape
!! options
@@ -16379,8 +16638,11 @@ __FORCETOC__
!! end
# perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
+# Parsoid html2wt direction adds for level 7 and up.
!! test
Handling of sections up to level 6 and beyond
+!! options
+parsoid=wt2html
!! wikitext
= Level 1 Heading=
== Level 2 Heading==
@@ -16392,7 +16654,7 @@ Handling of sections up to level 6 and beyond
======== Level 8 Heading========
========= Level 9 Heading=========
========== Level 10 Heading==========
-!! html
+!! html/php
Contents
1Level 1 Heading
@@ -16434,6 +16696,17 @@ Handling of sections up to level 6 and beyond
!!end
+# Parsoid doesn't wt2wt this cleanly because it adds s.
!! test
Short headings with trailing space should match behavior of Parser::doHeadings (T21910)
+!! options
+parsoid=wt2html,html2html
!! wikitext
===
The line above must have a trailing space!
===
But just in case it doesn't...
-!! html
+!! html/php
!! end
+# Parsoid html2wt disabled because it adds padding spaces around =
!! test
Headers with excess '=' characters
(Are similar tests necessary beyond the 1st level?)
+!! options
+parsoid=wt2html,wt2wt,html2html
!! wikitext
=foo==
==foo=
=''italic'' heading==
==''italic'' heading=
-!! html
+!! html/php
!! end
!! test
@@ -17567,9 +17919,11 @@ T4304: HTML attribute safety (unsafe breakout parameter 2; 2309)
T4304: HTML attribute safety (link)
!! wikitext
-!! html
-
+!! html/php
+
+!! html/parsoid
+
!! end
!! test
@@ -17630,9 +17984,11 @@ T4304: HTML attribute safety (web link)
T4304: HTML attribute safety (named web link)
!! wikitext
-!! html
-
+!! html/php
+
+!! html/parsoid
+
!! end
!! test
@@ -18196,18 +18552,16 @@ Nested template calls
### Sanitizer
###
-# HTML+Tidy effectively strips out the empty tags completely
-# But since Parsoid doesn't it wraps the tags in p-tags
-# which Tidy would have done for the PHP parser had there been content inside it.
+# HTML+Tidy strips out empty tags completely. Parsoid doesn't.
+# FIXME: Wikitext for this first test doesn't match its title.
!! test
Sanitizer: Closing of open tags
!! wikitext
-!! html
-
+!! html/php+tidy
!! html/parsoid
-
+
!! end
!! test
@@ -18243,24 +18597,37 @@ Table not started
!! test
Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id=""
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
!! wikitext
byte[[#æ: v|backlink]]
!! html/php
-
!! end
-# In HTML5, the restrictions are that id must contain at least one character,
-# and must not contain any space characters.
!! test
-Sanitizer: Validating the contents of the id attribute (T6515)
-!! options
-disabled
+Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" (legacy)
+!! config
+wgFragmentMode=[ 'legacy' ]
!! wikitext
-
+!! end
+
+# In HTML5, the restrictions are that id must contain at least one character,
+# and must not contain any space characters.
+!! test
+Sanitizer: Validating the contents of the id attribute (T6515)
+!! options
+disabled
+!! wikitext
+
+!! html
Something ...
!! end
@@ -18312,6 +18679,37 @@ parsoid=wt2html,wt2wt
2013
!! end
+!! test
+Sanitizer: Avoid unnecessary percent encoded characters in interwiki links
+!! wikitext
+[[meatball:Soft"Security]]
+!! html/php
+
+!! end
+
+!! test
+Sanitizer: angle brackets are invalid, even in interwiki links (T182338)
+!! wikitext
+[[meatball:FooBar]]
+[[meatball:Foo<bar]]
+[[meatball:Foo>bar]]
+!! html/php
+
+!! end
+
!! test
Self closed html pairs (T7487)
!! wikitext
@@ -18655,12 +19071,15 @@ Fuzz testing: Parser13
!! end
+# Note that Parsoid output differs from the PHP parser here: the PHP
+# parser breaks the URL for the magic word, while in Parsoid the URL
+# production takes precedence.
!! test
Fuzz testing: Parser14
!! wikitext
== onmouseover= ==
http://__TOC__
-!! html
+!! html/php
!! end
!! test
@@ -18704,7 +19126,7 @@ parsoid=wt2html,html2html
!! html/parsoid
-
a
+
a
!! end
@@ -18879,15 +19301,45 @@ Fuzz testing: image with bogus manual thumbnail
!! end
+# Parsoid will emit the newline literally in wt2wt; see next test case.
!! test
Fuzz testing: encoded newline in generated HTML replacements (T8577)
+!! options
+parsoid=wt2html
!! wikitext
!! html/php
!! html/parsoid
-
+
+!! end
+
+!! test
+Fuzz testing: encoded newline in generated HTML replacements, html2wt (T8577)
+!! options
+parsoid=html2wt
+!! html/parsoid
+
+!! wikitext
+
+!! html/php
+
+
+!! end
+
+!! test
+Templates in extension attributes are not expanded
+!! wikitext
+
+!! html/php
+
+
+!! html/parsoid
+
!! end
!! test
@@ -19917,7 +20369,7 @@ parsoid=wt2html
'''''
!! html/php
!! html/parsoid
-
+
!! end
# same html as previous, but wikitext adjusted to match parsoid html2wt
@@ -20041,7 +20493,7 @@ File:File:Foobar.jpg
!! html/parsoid
-
+
!! end
@@ -20104,12 +20556,12 @@ image4 |300px| centre
!! html/parsoid
!! end
@@ -20441,27 +20893,27 @@ foobar.jpg
!! html/parsoid
-
-
-
-
+
+
+
+
!! end
!! test
-Gallery override link with WikiLink (T36852)
+Gallery override link with wikilink (T36852)
!! options
parsoid={
"nativeGallery": true
}
!! wikitext
-File:Foobar.jpg|alt=galleryalt|link=InterWikiLink
+File:Foobar.jpg|alt=galleryalt|link=Wikilink
!! html/php
!! end
!! test
@@ -22116,7 +22617,7 @@ language=zh variant=zh-cn
A
!! html/parsoid
-
+
!! end
!! test
@@ -22129,7 +22630,7 @@ language=zh variant=zh-cn
A
!! html/parsoid
-
+
!! end
# Parsoid and PHP disagree on how to parse this example: Parsoid
@@ -22222,7 +22723,7 @@ parsoid={
|}
!! end
-# Tests LanguageVariantText._fromSelser
+# Tests LanguageVariantText._fromSelSer
!! test
LanguageConverter selser (4)
!! options
@@ -22402,15 +22903,9 @@ File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryalt
!! html/parsoid
-
-
-
-
-
-
-
-
This is a test template
-
+
+
+
This is a test template
!! end
@@ -22596,6 +23091,21 @@ a:b=>c xyz
!! end
+!! test
+T179579: Nowiki and lc interaction
+!! options
+parsoid=wt2html
+language=sr
+!! wikitext
+-{123}-
+
+-{123|456}-
+!! html/parsoid
+
+
+
+!! end
+
!! test
T2529: Uncovered bullet
!! wikitext
@@ -23580,7 +24090,7 @@ percent-encoding and + signs in internal links (T28410)
!! html/parsoid
!!end
+!! test
+Headings: 4c. Short headings (1)
+!! options
+parsoid=html2wt
+!! html/parsoid
+
===
+
+!! wikitext
+===
+!! html/php
+
===
+
+!! end
+
+# in the html2wt direction we emit '= = =' or '==='
+!! test
+Headings: 4d. Short headings (2)
+!! options
+parsoid=wt2html,html2html
+!! wikitext
+=
+==
+===
+====
+=====
+!! html/php
+
!! end
+!! test
+Catch regression when unpacking with trailing content
+!! wikitext
+{{echo|Foo bar}}
+!! html/parsoid
+
Foo
bar
+!! end
+
!! test
Use data-parsoid.firstWikitextNode to compute newline constraints for template content
!! options
@@ -29300,6 +29864,24 @@ wgRawHtml=1
!! test
Decoding of HTML entities in headings and links for IDs and link fragments (T103714)
+!! config
+wgFragmentMode=[ 'html5', 'legacy' ]
+!! wikitext
+== A&B&C&D&amp;E ==
+[[#A&B&C&D&amp;E]]
+!! html/php
+
+!! end
+
+!! test
+Decoding of HTML entities in headings and links for IDs and link fragments (T103714) (legacy)
+!! config
+wgFragmentMode=[ 'legacy' ]
!! wikitext
== A&B&C&D&amp;E ==
[[#A&B&C&D&amp;E]]
@@ -29309,17 +29891,46 @@ Decoding of HTML entities in headings and links for IDs and link fragments (T103
!! end
+!! test
+Decoding of HTML entities in embedded HTML tags
+!! wikitext
+
x
+!! html/php
+
x
+
+!! html/parsoid
+
x
+!! end
+
!! test
Decoding of HTML entities in indicator names for IDs (T104196)
!! options
+parsoid=wt2html,html2html
showindicators
!! wikitext
Indicator
!! html/php
1&2&3&4&5=Indicator
+!! html/parsoid
+
!! end
+# this version of the test strips out the ambiguity so Parsoid rts cleanly
+!! test
+Decoding of HTML entities in indicator names for IDs (unambiguous) (T104196)
+!! options
+showindicators
+!! wikitext
+Indicator
+!! html/php
+1&2&3&4&5=Indicator
+
+!! html/parsoid
+
+!! end
+
+# This fragment mode is what Parsoid supports.
!! test
HTML5 ids: fallback to legacy
!! config
@@ -29351,7 +29962,7 @@ wgFragmentMode=[ 'html5', 'legacy' ]
!! end
+# Parsoid doesn't support this mode
!! test
HTML5 ids: legacy with a fallback to modern
!! config
@@ -29407,13 +30037,14 @@ wgFragmentMode=[ 'legacy', 'html5' ]
+!! end
+
+!! test
+T51672: Test for brackets in attributes of elements in external link texts
+!! wikitext
+[http://example.com/ link span]
+[http://example.com/ link span]
+
+!! html/php
+
+!! end
+
+!! test
+T72875: Test for brackets in attributes of elements in internal link texts
+!! wikitext
+[[Foo|link span]]
+[[Foo|link span]]
+
+!! html/php
+
+!! end
+
+!! test
+T179544: {{anchorencode:}} output should be always usable in links
+!! config
+wgFragmentMode=[ 'html5' ]
+!! wikitext
+[[#{{anchorencode:[foo]}}]]
+!! html/php
+
+!! end
+
+# In this example, the template scope is mildly expanded to incorporate the
+# trailing newline after the transclusion since that is part of section 1.1.1
+!! test
+Section wrapping with template-generated sections (good nesting 2)
+!! options
+parsoid={
+ "wrapSections": true,
+ "modes": ["wt2html", "wt2wt"]
+}
+!! wikitext
+= 1 =
+a
+
+{{echo|1=
+== 1.1 ==
+b
+=== 1.1.1 ===
+d
+}}
+= 2 =
+e
+!! html/parsoid
+
1
+
a
+
+
1.1
+
b
+
1.1.1
+
d
+
2
+
e
+!! end
+
+# In this example, the template scope is mildly expanded to incorporate the
+# trailing newline after the transclusion since that is part of section 1.2.1
+!! test
+Section wrapping with template-generated sections (good nesting 3)
+!! options
+parsoid={
+ "wrapSections": true,
+ "modes": ["wt2html", "wt2wt"]
+}
+!! wikitext
+= 1 =
+a
+
+{{echo|1=
+x
+== 1.1 ==
+b
+==1.2==
+c
+===1.2.1===
+d
+}}
+= 2 =
+e
+!! html/parsoid
+
1
+
a
+
+
x
+
1.1
+
b
+
1.2
+
c
+
1.2.1
+
d
+
2
+
e
+!! end
+
+# Because of section-wrapping and template-wrapping interactions,
+# the scope of the template is expanded so that the template markup
+# is valid in the presence of tags.
+# This exercises the s1 is null scenario in the wrapSections code
+!! test
+Section wrapping with template-generated sections (bad nesting 1)
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+
+a
+
+{{echo|
+= 1 =
+b
+}}
+
+c
+
+!! html/parsoid
+
+
a
+
+
+
1
+
b
+
+
+
c
+
+!! end
+
+# Because of section-wrapping and template-wrapping interactions,
+# the scope of the template is expanded so that the template markup
+# is valid in the presence of tags.
+# This exercises the s1 is ancestor of s2 scenario in the wrapSections code
+!! test
+Section wrapping with template-generated sections (bad nesting 2)
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+= 1 =
+a
+
+{{echo|1=
+= 2 =
+b
+== 2.1 ==
+c
+}}
+
+d
+
+= 3 =
+e
+!! html/parsoid
+
1
+
a
+
+
2
+
b
+
2.1
+
c
+
+
d
+
+
3
+
e
+!! end
+
+# Because of section-wrapping and template-wrapping interactions,
+# additional template wrappers are added to tags
+# so that template wrapping semantics are valid whether section
+# tags are retained or stripped. But, the template scope can expand
+# greatly when accounting for section tags.
+# This exercises the s1 and s2 are in different subtrees scenario
+!! test
+Section wrapping with template-generated sections (bad nesting 3)
+!! options
+parsoid={
+ "wrapSections": true,
+ "modes": ["wt2html", "wt2wt"]
+}
+!! wikitext
+= 1 =
+a
+
+{{echo|1=
+== 1.2 ==
+b
+= 2 =
+c
+}}
+
+d
+
+= 3 =
+e
+!! html/parsoid
+
1
+
a
+
+
1.2
+
b
+
2
+
c
+
+
d
+
3
+
e
+!! end
+
+!! test
+Section wrapping with uneditable lead section + div wrapping multiple sections
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+foo
+
+
+= 1 =
+a
+
+== 1.1 ==
+b
+
+= 2 =
+c
+
+
+= 3 =
+d
+
+== 3.1 ==
+e
+!! html/parsoid
+
foo
+
+
+
1
+
a
+
+
1.1
+
b
+
+
2
+
c
+
+
+
3
+
d
+
+
3.1
+
e
+
+!! end
+
+!! test
+Section wrapping with editable lead section + div overlapping multiple sections
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+foo
+
+= 1 =
+a
+
+b
+
+== 1.1 ==
+c
+
+= 2 =
+d
+
+e
+
+= 3 =
+f
+
+== 3.1 ==
+g
+!! html/parsoid
+
foo
+
+
1
+
a
+
+
b
+
+
1.1
+
c
+
+
2
+
d
+
+
e
+
+
3
+
f
+
+
3.1
+
g
+
+!! end
+
+!! test
+HTML header tags should not be wrapped in section tags
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+foo
+
+
a
+
+= b =
+
+
c
+
+= d =
+!! html/parsoid
+
foo
+
+
a
+
+
b
+
+
c
+
+
d
+!! end
+
+!! test
+Lead section containing only whitespace and comments.
+!! options
+parsoid={
+ "wrapSections": true
+}
+!! wikitext
+
+
+= 1 =
+a
+
+= 2 =
+b
+!! html/parsoid
+
+
+