parsoid=html2wt,wt2wt
!! input
{{echo|foo<nowiki>|</nowiki>bar}}
+{{echo|<nowiki><div></nowiki>}}
+{{echo|<nowiki></nowiki>}}
!! result
-<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<nowiki>|</nowiki>bar"}},"i":0}'>foo<span typeof="mw:Nowiki" data-parsoid="{}">|</span>bar</p>
+<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo<nowiki>|</nowiki>bar"}},"i":0}'}'>foo</span><span typeof="mw:Nowiki" about="#mwt1">|</span><span about="#mwt1">bar</span>
+<span typeof="mw:Transclusion mw:Nowiki" about="#mwt2" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>&lt;div&gt;</nowiki>"}},"i":0}'><span typeof="mw:Entity"><</span>div<span typeof="mw:Entity">></span></span>
+<span typeof="mw:Transclusion mw:Nowiki" about="#mwt3" data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki></nowiki>"}},"i":0}'></span>
+</p>
!! end
###
!! end
-!! test
-Unbalanced closing block tags break a list
-(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
-<div>
-*a</div><div>
-*b</div>
-!! result
-<div>
-<ul><li>a
-</li></ul></div><div>
-<ul><li>b
-</li></ul></div>
-!! end
-
-!! test
-Unbalanced closing non-block tags don't break a list
-(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
-<span>
-*a</span><span>
-*b</span>
-!! result
-<p><span></span>
-</p>
-<ul><li>a<span></span>
-</li><li>b
-</li></ul>
-!! end
-
-!! test
-Unclosed formatting tags that straddle lists are closed and reopened
-(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
-!! options
-parsoid
-!! input
-# <s> a
-# b </s>
-!! result
-<ol><li> <s> a </s>
-</li><li> <s> b </s>
-</li></ol>
-!! end
-
-!!test
-List embedded in a non-block tag
-(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy)
-!! options
-parsoid
-!!input
-<small>
-* foo
-</small>
-!!result
-<p><small></small></p>
-<small>
-<ul>
-<li> foo</li>
-</ul>
-</small>
-<p><small></small></p>
-!!end
-
!! test
List items are not parsed correctly following a <pre> block (bug 785)
!! input
<ol><li> foo<ol><li> bar</li></ol></li></ol><ul><li> foo<ul><li> bar</li></ul></li></ul><dl><dd> foo<dl><dd> bar</dd></dl></dd></dl>
!! end
+# ------------------------------------------------------------------------
+# The next set of tests are about Parsoid's ability to handle badly nested
+# tags (parse, minimize scope of fixup, and roundtrip back)
+# ------------------------------------------------------------------------
+
+!! test
+Unbalanced closing block tags break a list
+(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
+!! options
+parsoid
+!! input
+<div>
+*a</div><div>
+*b</div>
+!! result
+<div>
+<ul><li>a
+</li></ul></div><div>
+<ul><li>b
+</li></ul></div>
+!! end
+
+!! test
+Unbalanced closing non-block tags don't break a list
+(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
+!! options
+parsoid
+!! input
+<span>
+*a</span><span>
+*b</span>
+!! result
+<p><span></span>
+</p>
+<ul><li>a<span></span>
+</li><li>b
+</li></ul>
+!! end
+
+!! test
+Unclosed formatting tags that straddle lists are closed and reopened
+(Parsoid-only since php parser generates broken html -- relies on Tidy to fix up)
+!! options
+parsoid
+!! input
+# <s> a
+# b </s>
+!! result
+<ol><li> <s> a </s>
+</li><li> <s> b </s>
+</li></ol>
+!! end
+
+!!test
+List embedded in a non-block tag
+(Ugly Parsoid output -- worth fixing; Disabled for PHP parser since it relies on Tidy)
+!! options
+parsoid
+!!input
+<small>
+* foo
+</small>
+!!result
+<p><small></small></p>
+<small>
+<ul>
+<li> foo</li>
+</ul>
+</small>
+<p><small></small></p>
+!!end
###
### Magic Words
</p>
!! end
+!! test
+Parsoid: Link prefix/suffixes aren't applied to category links
+!! options
+parsoid=wt2html,wt2wt,html2html
+language=is
+!! input
+x[[Category:Foo]]y
+!! result
+<p>x<link rel="mw:WikiLink/Category" href="Category:Foo">y</p>
+!! end
+
!! test
Parsoid: Serialize link to file page with colon escape
!! options
<references />
!!result
-<p><span about="#mwt1" class="reference" data-mw='{"name":"ref","body":{"html":"foo &lt;ref&gt;bar"},"attrs":{}}' id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span> baz</ref></p>
+<span about="#mwt1" class="reference" data-mw="{"name":"ref","body":{"html":"foo &lt;ref&gt;bar&lt;/ref&gt; baz"},"attrs":{}}" id="cite_ref-1-0" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1">[1]</a></span>
-<ol about="#mwt2" class="references" data-mw='{"name":"references","attrs":{}}' typeof="mw:Extension/references"><li about="#cite_note-1" id="cite_note-1"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <ref>bar</li></ol>
+<ol class="references" typeof="mw:Extension/references" about="#mwt2" data-mw="{"name":"references","attrs":{}}">
+<li about="#cite_note-1" id="cite_note-1" data-parsoid="{}"><span rel="mw:referencedBy"><a href="#cite_ref-1-0">↑</a></span> foo <ref>bar</ref> baz</li></ol>
!!end
!!test
parsoid
!! input
=foo=
-<nowiki>*bar</nowiki>
+<nowiki>*</nowiki>bar
=foo=
=bar
!! input
<nowiki>=a=</nowiki>
-<nowiki>=a= </nowiki>
+<nowiki>=a=</nowiki>
-<nowiki>=a= </nowiki>
+<nowiki>=a=</nowiki>
-<nowiki>=a= </nowiki>
+<nowiki>=a=</nowiki>
!! result
<p>=a=</p>
<p>=a= </p>
!! options
parsoid
!! input
-<nowiki>a
-=b=</nowiki>
+a
+<nowiki>=b=</nowiki>
!! result
<p>a
=b=</p>
!! input
<!--c0--><nowiki>=a=</nowiki>
<!--c1-->
-<nowiki>=a= </nowiki><!--c2--> <!--c3-->
+<nowiki>=a=</nowiki> <!--c2--> <!--c3-->
!! result
<p><!--c0-->=a=</p>
<p><!--c1-->=a= <!--c2--> <!--c3--></p>
!! test
Lists: 0. Outside nests
!! input
-<nowiki>*foo</nowiki>
+<nowiki>*</nowiki>foo
-<nowiki>#foo</nowiki>
+<nowiki>#</nowiki>foo
!! result
<p>*foo
</p><p>#foo
!! test
Lists: 7. Escape bullets in a multi-line context
!! input
-<nowiki>a
-*b</nowiki>
+a
+<nowiki>*</nowiki>b
!! result
<p>a
*b
!! options
parsoid
!! input
-[[Foo|<nowiki>Foo''boo''</nowiki>]]
+[[Foo|Foo<nowiki>''boo''</nowiki>]]
!! result
<a rel="mw:WikiLink" href="Foo">Foo''boo''</a>
!! end
!! options
parsoid
!! input
-<nowiki> a</nowiki>
+<nowiki> </nowiki>a
-<nowiki> a</nowiki>
+<nowiki> </nowiki> a
-<nowiki> a(tab)</nowiki>
+<nowiki> </nowiki>a(tab)
-<nowiki> a</nowiki>
+<nowiki> </nowiki> a
<!--cmt-->
-<nowiki> a</nowiki>
+<nowiki> </nowiki> a
-<nowiki>a
- b</nowiki>
+a
+<nowiki> </nowiki>b
-<nowiki>a
- b</nowiki>
+a
+<nowiki> </nowiki>b
-<nowiki>a
- b</nowiki>
+a
+<nowiki> </nowiki> b
!! result
<p> a</p>
<p> a</p>
</ul>
!! end
+!! test
+Parsoid: Serialize positional parameters with = in them as named parameter
+!! options
+parsoid=html2wt
+!! input
+{{echo|1 = f=oo}}
+!! result
+<p about="#mwt1" typeof="mw:Transclusion"
+data-mw='{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"f=oo"}},"i":0}'
+>foo</p>
+!! end
+
+# -----------------------------------------------------------------
+# End of section for Parsoid-only html2wt tests for serialization
+# of new content
+# -----------------------------------------------------------------
TODO:
more images