<dl>
<dt>
<dl>
-<dt> foo<span typeof="mw:Placeholder" data-parsoid='{"src":" "}'> </span></dt>
+<dt> foo<span typeof="mw:Placeholder"> </span></dt>
<dd data-parsoid='{"stx":"row"}'> bar (who uses this?)</dd>
</dl></dt>
</dl></dd>
!! end
-
# The "|}" to close the table is missing from the input, so parsoid's
# *2wt modes will fail.
!! test
<td><a rel="mw:ExtLink" href="ftp://|x||"></a>" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
!! end
+# FIXME: The php output is broken.
+!! test
+! and || in td attributes should not be parsed as <th>/<td>
+!! wikitext
+{|
+| style="color: red !important;" data-contrived="put this here ||" | foo
+|}
+!! html/php
+<table>
+<tr>
+<td> style="color: red !important;" data-contrived="put this here </td>
+<td> foo
+</td></tr></table>
+
+!! html/parsoid
+<table>
+<tbody><tr><td style="color: red !important;" data-contrived="put this here ||" data-parsoid='{"autoInsertedEnd":true}'> foo</td></tr>
+</tbody></table>
+!! end
!! test
Indented table markup mixed with indented pre content (proposed in bug 6200)
</p>
!! end
+# From plwiki:PLOS_ONE
+!! test
+Parsoid: Page property magic word with magic word contents
+!! options
+parsoid
+!! wikitext
+{{DISPLAYTITLE:''{{PAGENAME}}''}}
+!! html
+<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"content"},{"html":"<i data-parsoid=\"{&quot;dsr&quot;:[15,31,2,2]}\"><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=\"{&quot;pi&quot;:[[]],&quot;dsr&quot;:[17,29,null,null]}\" data-mw=\"{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;PAGENAME&quot;,&quot;function&quot;:&quot;pagename&quot;},&quot;params&quot;:{},&quot;i&quot;:0}}]}\">Main Page</span></i>"}]]}'/>
+!! end
+
!! test
Namespace 1 {{ns:1}}
!! wikitext
!! options
parsoid=html2wt
!! html
-<meta property="mw:PageProp/forcetoc" data-parsoid='{"src":"__NOTOC__","magicSrc":"__NOTOC__"}'/>
+<meta property="mw:PageProp/forcetoc" data-parsoid='{"magicSrc":"__NOTOC__"}'/>
!! wikitext
__FORCETOC__
!! end
!! wikitext
__NOEDITSECTION__
!! html
-<meta property="mw:PageProp/noeditsection" data-parsoid='{"src":"__NOEDITSECTION__","magicSrc":"__NOEDITSECTION__"}'/>
+<meta property="mw:PageProp/noeditsection" data-parsoid='{"magicSrc":"__NOEDITSECTION__"}'/>
!! end
###
|c
|}
!!html/parsoid
-<meta typeof="mw:Includes/IncludeOnly" data-parsoid='{"src":"<includeonly>a</includeonly>"'/><meta typeof="mw:Includes/IncludeOnly/End" data-parsoid='{"src":""}'/><table about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"{{{b}}}","html":"<span about=\"#mwt1\" typeof=\"mw:Param\" data-parsoid=\"{&quot;dsr&quot;:[31,38,null,null],&quot;src&quot;:&quot;{{{b}}}&quot;}\">{{{b}}}</span>"},{"html":""}]]}' data-parsoid='{"a":{"{{{b}}}":null},"sa":{"{{{b}}}":""}}'>
+<meta typeof="mw:Includes/IncludeOnly"/><meta typeof="mw:Includes/IncludeOnly/End"/><table about="#mwt2" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"{{{b}}}","html":"<span about=\"#mwt1\" typeof=\"mw:Param\" data-parsoid=\"{&quot;dsr&quot;:[31,38,null,null],&quot;src&quot;:&quot;{{{b}}}&quot;}\">{{{b}}}</span>"},{"html":""}]]}' data-parsoid='{"a":{"{{{b}}}":null},"sa":{"{{{b}}}":""}}'>
<tbody><tr><td>c</td></tr>
</tbody></table>
!!end
-
!! test
HTML bullet list, closed tags (bug 5497)
!! wikitext
<div style="border : solid;"> </div>
!! html/parsoid
-<div style="width:50% !important" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span></div>
-<div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&nbsp;!important"}}'><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span></div>
-<div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&#160;!important"}}'><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span></div>
-<div style="border : solid;" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span></div>
+<div style="width:50% !important" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
+<div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&nbsp;!important"}}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
+<div style="width:50% !important" data-parsoid='{"stx":"html","a":{"style":"width:50% !important"},"sa":{"style":"width:50%&#160;!important"}}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
+<div style="border : solid;" data-parsoid='{"stx":"html"}'><span typeof="mw:Entity" data-parsoid='{"srcContent":" "}'> </span></div>
!! end
!! wikitext
<ref name="test & me">hi</ref>
!! html
-<p><span about="#mwt2" class="reference" id="cite_ref-test_.26_me_1-0" rel="dc:references" typeof="mw:Extension/ref" data-parsoid='{"src":"<ref name=\"test &amp; me\">hi</ref>"}' data-mw='{"name":"ref","body":{"html":"hi"},"attrs":{"name":"test &amp; me"}}'><a href="#cite_note-test_.26_me-1">[1]</a></span></p>
+<p><span about="#mwt2" class="reference" id="cite_ref-test_.26_me_1-0" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"html":"hi"},"attrs":{"name":"test &amp; me"}}'><a href="#cite_note-test_.26_me-1">[1]</a></span></p>
!! end
# This test is wt2html only because we're permitting the serializer to produce
}}
</table>
!! html/parsoid
-<table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n",{"template":{"target":{"wt":"#if:","function":"#if"},"params":{"1":{"wt":"\n<td>foo</td>\n"}},"i":0}},"\n</table>"]}' data-parsoid='{"stx":"html","pi":[[{"k":"1","spc":["","","",""]}]],"src":"<table>\n{{#if:|\n<td>foo</td>\n}}\n</table>"}'>
+<table about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":["<table>\n",{"template":{"target":{"wt":"#if:","function":"#if"},"params":{"1":{"wt":"\n<td>foo</td>\n"}},"i":0}},"\n</table>"]}' data-parsoid='{"stx":"html","pi":[[{"k":"1","spc":["","","",""]}]]}'>
</table>
!! end
== <span> baz</span> ==
!! end
+!! test
+Headings: Force metas to serialize before/after
+!! options
+parsoid=html2wt
+!! html
+<h2>hello there<link href="Category:A1" rel="mw:PageProp/Category" /></h2>
+<h2><link href="Category:A2" rel="mw:PageProp/Category" />hi pal</h2>
+!! wikitext
+== hello there ==
+[[Category:A1]]
+
+[[Category:A2]]
+== hi pal ==
+!! end
+
!! test
Parsoid: Serialize positional parameters with = in them as named parameter
!! options
!! options
parsoid=html2wt
!! html
-<link rel="mw:PageProp/redirect" href="Bar" data-parsoid='{"src":"#REDIRECT ","a":{"href":"./Foo"},"sa":{"href":"Foo"}}'>
+<link rel="mw:PageProp/redirect" href="Bar" data-parsoid='{"a":{"href":"./Foo"},"sa":{"href":"Foo"}}'>
!! wikitext
#REDIRECT [[Bar]]
!! end