!! 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
###
</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
+
##
## XHTML tidiness
###
<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
<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
<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
<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
</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
+
###
### Inter-language links
###
!! options
parsoid
!! input
+<nowiki>=a=</nowiki>
+
+<nowiki>=a= </nowiki>
+
+<nowiki>=a= </nowiki>
+
+<nowiki>=a= </nowiki>
!! result
<p>=a=</p>
<p>=a= </p>
''<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