diff options
author | Arlo Breault <abreault@wikimedia.org> | 2021-04-26 15:08:46 -0400 |
---|---|---|
committer | Arlo Breault <abreault@wikimedia.org> | 2021-04-26 15:09:39 -0400 |
commit | c32e539bcd78820b0bcdecb727cebb718950e15e (patch) | |
tree | 82352562dd54670c45ed937abe3250679fabbd3c /tests | |
parent | ee3832ef9663aa6a95a8e6ccaa98da699ff0a7fe (diff) | |
download | mediawikicore-c32e539bcd78820b0bcdecb727cebb718950e15e.tar.gz mediawikicore-c32e539bcd78820b0bcdecb727cebb718950e15e.zip |
Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit 760eb7ea841efff29a9e740662985c330501601b
Change-Id: I06928d461e2948db2b23806e64adb2de4ef2c724
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/parserTests.txt | 154 |
1 files changed, 141 insertions, 13 deletions
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 4366940e71e9..677853b1fab2 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1742,6 +1742,19 @@ protection !! here |} !! end +!! test +Nowiki with newlines in list +!! wikitext +:<nowiki>test +123</nowiki> +!! html/php +<dl><dd>test +123</dd></dl> +!! html/parsoid +<dl><dd data-parsoid="{}"><span typeof="mw:Nowiki">test +123</span></dd></dl> +!! end + ## The output here may change with the outcome of T255007 !! test Nowiki and french spacing @@ -1785,6 +1798,9 @@ French spacing and spans <p><a href="/index.php?title=Test&action=edit&redlink=1" class="new" title="Test (page does not exist)">Test</a> : <span>123</span> « Test »<span>123</span> </p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Test" title="Test" class="new">Test</a><span typeof="mw:DisplaySpace"> </span>: <span data-parsoid='{"stx":"html"}'>123</span> +«<span typeof="mw:DisplaySpace"> </span>Test<span typeof="mw:DisplaySpace"> </span>»<span data-parsoid='{"stx":"html"}'>123</span></p> !! end ### @@ -2076,6 +2092,18 @@ IE conditional comments <![endif]--> !! end +## Regession test for Parsoid +!! test +Comment with valid json +!! wikitext +hi <!--{"hi":"ho"}--> ho +!! html/php +<p>hi ho +</p> +!! html/parsoid +<p>hi <!--{"hi":"ho"}--> ho</p> +!! end + ### ### paragraph wrapping tests ### @@ -7108,6 +7136,23 @@ Table cell attributes: Pipes protected by nowikis should be treated as a plain c </tbody></table> !! end +!! test +Table cell attributes: Pipes protected by nested nowikis should be treated as a plain character +!! wikitext +{| +|<code><nowiki>{{ACB|PG}}</nowiki></code> +|} +!! html/php +<table> +<tbody><tr> +<td><code>{{ACB|PG}}</code> +</td></tr></tbody></table> +!! html/parsoid +<table> +<tbody><tr><td><code><span typeof="mw:Nowiki">{{ACB|PG}}</span></code></td></tr> +</tbody></table> +!! end + # See: http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html # N.B. The "|}" to close the table is missing from the input, so parsoid's # *2wt modes will fail. @@ -10445,6 +10490,42 @@ parsoid={ !! end !! test +1. Lists and block-element interaction +!! options +parsoid=wt2html,selser +!! wikitext +*<div>a +*b +</div>ಕ +!! html/php+tidy +<ul><li><div>a</div></li> +<li>b</li></ul> +<p>ಕ</p> +!! html/parsoid +<ul><li><div data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a</div></li> +<li>b</li></ul> +<p>ಕ</p> +!! end + +!! test +2. Lists and block-element interaction +!! options +parsoid=wt2html,selser +!! wikitext +*{{1x|<div>a +*b +}}</div>ಕ +!! html/php+tidy +<ul><li><div>a</div></li> +<li>b</li></ul> +<p>ಕ</p> +!! html/parsoid +<ul about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"firstWikitextNode":"UL","pi":[[{"k":"1"}]]}' data-mw='{"parts":["*",{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"<div>a\n*b\n"}},"i":0}}]}'><li><div>a</div></li> +<li>b</li></ul><span about="#mwt1"> +</span><p>ಕ</p> +!! end + +!! test 1. Lists with start-of-line-transparent tokens before bullets: Comments !! wikitext *foo @@ -13685,27 +13766,22 @@ Template:quote Templates: Template Name/Arg clash: 1. Use of positional param !! wikitext {{quote|foo}} -!! html +!! html/php <p>foo </p> +!! html/parsoid +<p><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"quote","href":"./Template:Quote"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span></p> !!end !!test Templates: Template Name/Arg clash: 2. Use of named param !! wikitext {{quote|quote=foo}} -!! html +!! html/php <p>foo </p> -!!end - -!!test -Templates: Template Name/Arg clash: 3. Use of named param with empty input -!! wikitext -{{quote|quote}} -!! html -<p>quote -</p> +!! html/parsoid +<p><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"quote","href":"./Template:Quote"},"params":{"quote":{"wt":"foo"}},"i":0}}]}'>foo</span></p> !!end ### @@ -15518,6 +15594,19 @@ subpage title=[[Page]] </p> !! end +!! test +Subpage with namespaces +!! options +subpage title=[[Subpage test/1/2/3/4]] +!! wikitext +[[User:../subpage]] +[[meatball:../subpage]] +!! html +<p>[[User:../subpage]] +[[meatball:../subpage]] +</p> +!! end + ### ### Categories ### @@ -15582,6 +15671,20 @@ cat=MediaWiki_User's_Guide sort=MediaWiki User's Guide !! end !! test +Category with newline in sort key +!! options +cat +parsoid=wt2html,html2html +!! wikitext +[[Category:Wikidata:Tools| +*]] +!! html/php +cat=Wikidata:Tools sort=* +!! html/parsoid +<link rel="mw:PageProp/Category" href="./Category:Wikidata:Tools#*"/> +!! end + +!! test Category with template-generated sort key !! options cat @@ -17289,13 +17392,38 @@ Media link to nonexistent file (T3702) !! end !! test +Media link with nested wikilinks +!! wikitext +[[Media:Foobar.jpg|[[Test]]]] +[[Media:Foobar.jpg|[[File:Foobar.jpg]]]] +!! html/php +<p>[[Media:Foobar.jpg|<a href="/index.php?title=Test&action=edit&redlink=1" class="new" title="Test (page does not exist)">Test</a>]] +[[Media:Foobar.jpg|<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" decoding="async" width="1941" height="220" /></a>]] +</p> +!! html/parsoid +<p>[[Media:Foobar.jpg|<a rel="mw:WikiLink" href="./Test" title="Test" class="new">Test</a>]] +[[Media:Foobar.jpg|<span class="mw-default-size" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span>]]</p> +!! end + +!! test +Media link with multiple options +!! wikitext +[[Media:Foobar.jpg|123|345]] +!! html/php +<p><a href="http://example.com/images/3/3a/Foobar.jpg" class="internal" title="Foobar.jpg">123|345</a> +</p> +!! html/parsoid +<p><a rel="mw:MediaLink" href="http://example.com/images/3/3a/Foobar.jpg" resource="./Media:Foobar.jpg" title="Foobar.jpg">123|345</a></p> +!! end + +!! test Character reference normalization in link text (T3938) !! wikitext [[Main Page|this&that]] !! html <p><a href="/wiki/Main_Page" title="Main Page">this&that</a> </p> -!!end +!! end !! article אַ @@ -21901,7 +22029,7 @@ Balinese language conversion language=ban variant=ban-x-palmleaf !! wikitext ᬫᬦ᭄ᬢ᭄ᬭ -{ban-x-palmleaf:AAA;ban:BBB}- -!! html +!! html/php <p>mantra AAA </p> !! end |