jenkins-bot has submitted this change and it was merged.
Change subject: Sync up with Parsoid tests
......................................................................
Sync up with Parsoid tests
Change-Id: Id1d80a581564d0365c04953da4f41b086a2bc0d8
---
M tests/parser/parserTests.txt
1 file changed, 146 insertions(+), 4 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 468ebb6..17f9437 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -1515,6 +1515,17 @@
!! end
+!! test
+Templates: Parsoid parameter escaping test 1
+!! options
+parsoid
+!! input
+{{echo|[foo]|{{echo|[bar]}}}}
+!! result
+<p about="#mwt1" typeof="mw:Transclusion"
+data-mw="{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}">[foo]</p>
+!! end
+
###
### Parsoid-centric tests for testing RT edge cases for pre
###
@@ -4541,6 +4552,84 @@
!!result
<p><a href="/index.php?title=WW_II&action=edit&redlink=1" class="new"
title="WW II (lonkásá ezalí tɛ̂)">WW II</a>
</p>
+!! end
+
+!! test
+Parsoid: handle constructor well
+!! options
+parsoid
+!! input
+[[constructor]]
+
+[[constructor:foo]]
+!! result
+<p data-parsoid="{"dsr":[0,15,0,0]}"><a rel="mw:WikiLink"
href="./Constructor"
data-parsoid="{"stx":"simple","a":{"href":"./Constructor"},"sa":{"href":"constructor"},"dsr":[0,15,2,2]}">constructor</a></p>
+
+
+<p data-parsoid="{"dsr":[17,36,0,0]}"><a rel="mw:WikiLink"
href="./Foo"
data-parsoid="{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"constructor:foo"},"dsr":[17,36,2,2]}">constructor:foo</a></p>
+!! end
+
+##
+## Redirects, Parsoid-only
+##
+!! test
+Simple redirect to page
+!! options
+parsoid
+!! input
+#REDIRECT [[Main Page]]
+!! result
+<link rel="mw:PageProp/redirect" href="./Main_Page">
+!! end
+
+!! test
+Redirect to category
+!! options
+parsoid=wt2html
+!! input
+#REDIRECT [[Category:Foo]]
+!! result
+<link rel="mw:PageProp/redirect" href="./Category:Foo"><link
rel="mw:WikiLink/Category" href="./Category:Foo">
+!! end
+
+!! test
+Redirect to category page
+!! options
+parsoid=wt2html,html2html
+!! input
+#REDIRECT [[:Category:Foo]]
+!! result
+<p><a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a></p>
+!! end
+
+!! test
+Redirect to image page
+!! options
+parsoid
+!! input
+#REDIRECT [[File:Wiki.png]]
+!! result
+<link rel="mw:PageProp/redirect" href="./File:Wiki.png">
+!! end
+
+!! test
+Redirect to language
+!! options
+parsoid
+!! input
+#REDIRECT [[en:File:Wiki.png]]
+!! result
+<link rel="mw:PageProp/redirect" href="File:Wiki.png">
+!! end
+
+!! test
+Redirect to interwiki
+!! options
+parsoid
+!! input
+#REDIRECT [[meatball:File:Wiki.png]]
+!! result
+<link rel="mw:PageProp/redirect" href="File:Wiki.png">
!! end
##
@@ -8140,7 +8229,7 @@
<a href="File:Foobar.jpg">
<img resource="./File:Foobar.jpg"
src="//upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/180px-Foobar.jpg"
height="21" width="180" />
</a>
-<figcaption class="mw-figcaption">caption content</figcaption>
+<figcaption>caption content</figcaption>
</figure>
!! end
@@ -8155,7 +8244,7 @@
<a href="File:Foobar.jpg">
<img resource="./File:Foobar.jpg"
src="//upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/50px-Foobar.jpg"
height="6" width="50" />
</a>
-<figcaption class="mw-figcaption">caption</figcaption>
+<figcaption>caption</figcaption>
</figure>
!! end
@@ -8170,7 +8259,7 @@
<a href="File:Foobar.jpg">
<img resource="./File:Foobar.jpg"
src="//upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/442px-Foobar.jpg"
height="50" width="442" />
</a>
-<figcaption class="mw-figcaption">caption</figcaption>
+<figcaption>caption</figcaption>
</figure>
!! end
@@ -8185,7 +8274,7 @@
<a href="File:Foobar.jpg">
<img resource="./File:Foobar.jpg"
src="//upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg/442px-Foobar.jpg"
height="50" width="442" />
</a>
-<figcaption class="mw-figcaption">caption</figcaption>
+<figcaption>caption</figcaption>
</figure>
!! end
@@ -8433,6 +8522,48 @@
</p><p>Foo
Bar
</p>
+!! end
+
+!! test
+Parsoid: Serialize link to category page with colon escape
+!! options
+parsoid
+!! input
+
+[[:Category:Foo]]
+[[:Category:Foo|Bar]]
+!! result
+<p>
+<a rel="mw:WikiLink" href="Category:Foo">Category:Foo</a>
+<a rel="mw:WikiLink" href="Category:Foo">Bar</a>
+</p>
+!! end
+
+!! test
+Parsoid: Serialize link to file page with colon escape
+!! options
+parsoid
+!! input
+
+[[:File:Foo.png]]
+[[:File:Foo.png|Bar]]
+!! result
+<p>
+<a rel="mw:WikiLink" href="File:Foo.png">File:Foo.png</a>
+<a rel="mw:WikiLink" href="File:Foo.png">Bar</a>
+</p>
+!! end
+
+!! test
+Parsoid: Serialize a genuine category link without colon escape
+!! options
+parsoid
+!! input
+[[Category:Foo]]
+[[Category:Foo|Bar]]
+!! result
+<link rel="mw:WikiLink/Category" href="Category:Foo">
+<link rel="mw:WikiLink/Category" href="Category:Foo#Bar">
!! end
###
@@ -14596,6 +14727,13 @@
!! options
parsoid
!! input
+<nowiki>=a=</nowiki>
+
+<nowiki>=a= </nowiki>
+
+<nowiki>=a= </nowiki>
+
+<nowiki>=a= </nowiki>
!! result
<p>=a=</p>
<p>=a= </p>
@@ -15164,18 +15302,22 @@
''<nowiki>'foo'</nowiki>''
''<nowiki>''foo''</nowiki>''
''<nowiki>'''foo'''</nowiki>''
+''foo''<nowiki>'s</nowiki>
'''<nowiki>'foo'</nowiki>'''
'''<nowiki>''foo''</nowiki>'''
'''<nowiki>'''foo'''</nowiki>'''
'''<nowiki>foo'</nowiki>''<nowiki>bar'</nowiki>''baz'''
+'''foo'''<nowiki>'s</nowiki>
!! result
<p><i>'foo'</i>
<i>''foo''</i>
<i>'''foo'''</i>
+<i>foo</i>'s
<b>'foo'</b>
<b>''foo''</b>
<b>'''foo'''</b>
<b>foo'<i>bar'</i>baz</b>
+<b>foo</b>'s
</p>
!! end
--
To view, visit https://gerrit.wikimedia.org/r/70922
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id1d80a581564d0365c04953da4f41b086a2bc0d8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits