</td></tr></tbody></table>
!! end
+!! test
+Bold conversion test
+!! wikitext
+a b'''c ''d e'''f'' g h'''i ''j
+!! options
+parsoid=wt2html
+!! html+tidy
+<p>a b'<i>c </i>d e<b>f<i> g h</i></b><i>i </i>j
+</p>
+!! end
+
###
### Non-html5 tags
###
b </p><div> foo </div>
!! end
-!!test
+!! test
3c. Indent-Pre and block tags (pre-content on separate line)
!! wikitext
<p>
foo
</li></ul>
-!! html
+!! html/php
<p>
foo
</p>
foo
</li></ul>
-!!end
+!! html/parsoid
+<p data-parsoid='{"stx":"html"}'>
+ foo
+</p>
+
+<div>
+<pre>foo</pre>
+</div>
+
+<center>
+<pre>foo</pre>
+</center>
+
+<blockquote>
+<p> foo</p>
+</blockquote>
+
+<blockquote>
+<pre typeof="mw:Extension/pre" about="#mwt3" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"\nfoo\n"}}'>foo
+</pre>
+</blockquote>
+
+<table data-parsoid='{"stx":"html"}'><tbody><tr data-parsoid='{"stx":"html"}'><td data-parsoid='{"stx":"html"}'>
+<pre>foo</pre>
+</td></tr></tbody></table>
+
+<ul data-parsoid='{"stx":"html"}'><li data-parsoid='{"stx":"html"}'>
+ foo
+</li></ul>
+!! end
!! test
4. Indent-Pre and extension tags
!! html/parsoid
<table>
<tbody><tr><td title="foo">bar</td>
-<td title="foo|" data-parsoid='{"a":{"title":"foo|"},"sa":{"title":"foo<nowiki>|</nowiki>"},"autoInsertedEnd":true}'>bar</td>
-<td> title="foo<span typeof="mw:Nowiki">|</span>" bar</td></tr>
+<td title="foo|" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"a":{"title":"foo|"},"sa":{"title":"foo<nowiki>|</nowiki>"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"foo<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[32,50,8,9]}'>|</span>"}]]}'>bar</td>
+<td>title="foo<span typeof="mw:Nowiki">|</span>" bar</td></tr>
</tbody></table>
!! end
<nowiki> inside a link
!! wikitext
[[Main<nowiki> Page</nowiki>]] [[Main Page|the main page <nowiki>[it's not very good]</nowiki>]]
-!! html
+!! html/php+tidy
<p>[[Main Page]] <a href="/wiki/Main_Page" title="Main Page">the main page [it's not very good]</a>
</p>
+!! html/parsoid
+<p>[[Main<span typeof="mw:Nowiki"> Page</span>]] <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">the main page <span typeof="mw:Nowiki">[it's not very good]</span></a></p>
+!! end
+
+## Parsoid doesn't get this right and even fails wt2html because, when doing the
+## normalization for comparison, the html serialization / re-parse doesn't
+## roundtrip. This is T49963
+!! test
+<pre> inside a link
+!! wikitext
+[[Main<pre> Page</pre>]] [[Main Page|the main page <pre>[it's not very good]</pre>]]
+!! html/php+tidy
+<p>[[Main</p><pre> Page</pre><p>]] <a href="/wiki/Main_Page" title="Main Page">the main page </a></p><a href="/wiki/Main_Page" title="Main Page"><pre>[it's not very good]</pre></a>
+!! html/parsoid
+<p>[[Main</p><pre typeof="mw:Extension/pre" about="#mwt4" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":" Page"}}'> Page</pre><p>]] <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">the main page <pre typeof="mw:Extension/pre" about="#mwt6" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"[it's not very good]"}}'>[it's not very good]</pre></a></p>
!! end
!! test
</p>
!! end
+## The interwiki case here continued to be legacy escaped because of the
+## default setting of $wgExternalInterwikiFragmentMode
!! test
Link scenarios with escaped fragments
!! options
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Main_Page#Is_this_great?" data-parsoid='{"stx":"simple","a":{"href":"./Main_Page#Is_this_great?"},"sa":{"href":"#Is this great?"}}'>#Is this great?</a>
<a rel="mw:WikiLink" href="./Foo#Is_this_great?" title="Foo" data-parsoid='{"stx":"simple","a":{"href":"./Foo#Is_this_great?"},"sa":{"href":"Foo#Is this great?"}}'>Foo#Is this great?</a>
-<a rel="mw:WikiLink/Interwiki" href="http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great?" title="meatball:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great?"},"sa":{"href":"meatball:Foo#Is this great?"},"isIW":true}'>meatball:Foo#Is this great?</a></p>
+<a rel="mw:WikiLink/Interwiki" href="http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F" title="meatball:Foo" data-parsoid='{"stx":"simple","a":{"href":"http://www.usemod.com/cgi-bin/mb.pl?Foo#Is_this_great.3F"},"sa":{"href":"meatball:Foo#Is this great?"},"isIW":true}'>meatball:Foo#Is this great?</a></p>
!! end
!! test
<p>But if the broken language converter markup is inside an extension tag, nothing bad happens:</p>
<ul>
<li><span typeof="mw:Nowiki">foo-{bar}bat</span></li>
-<li><span typeof="mw:Transclusion mw:Nowiki" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>foo-{bar}bat</nowiki>"}},"i":0}}]}'>foo-{bar}bat</span></li>
+<li><span typeof="mw:Nowiki mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<nowiki>foo-{bar}bat</nowiki>"}},"i":0}}]}'>foo-{bar}bat</span></li>
<li><pre typeof="mw:Extension/pre" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo-{bar}bat"}}'>foo-{bar}bat</pre></li>
<li><pre typeof="mw:Extension/pre mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<pre>foo-{bar}bat</pre>"}},"i":0}}]}'>foo-{bar}bat</pre></li>
</ul>
!! end
# FIXME Parsoid doesn't actually match PHP here.
-# Probably we should use the synthetic <foo /> or <indicator>
-# extensions for this test, which are enabled when running parser tests.
!! test
Extension tag in attribute value
+!! options
+wgRawHtml=1
!! wikitext
-<span title="<translate>123</translate>">ok</span>
-!! html/php+disabled
-<p><span title="<translate>123</translate>">ok</span>
+<span title="<html><div>123</div></html>">ok</span>
+!! html/php+tidy
+<p><span title="<div>123</div>">ok</span>
</p>
!! html/parsoid
-<p><span title="123" about="#mwt4" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"123"},"sa":{"title":"<translate>123</translate>"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"<translate typeof=\"mw:Extension/translate\" about=\"#mwt3\" data-parsoid='{\"dsr\":[13,39,2,2]}' data-mw='{\"name\":\"translate\",\"attrs\":{},\"body\":{\"extsrc\":\"123\"}}'>123</translate>"}]]}'>ok</span></p>
+<p><span title="123" about="#mwt4" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"123"},"sa":{"title":"<html><div>123</div></html>"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"<div typeof=\"mw:Extension/html\" about=\"#mwt3\" data-parsoid='{\"dsr\":[13,40,2,2]}' data-mw='{\"name\":\"html\",\"attrs\":{},\"body\":{\"extsrc\":\"&lt;div>123&lt;/div>\"}}'>123</div>"}]]}'>ok</span></p>
!! end
!! test
<div style="background:blue"></div>
!! html/parsoid
-<div style="background:blue" data-parsoid='{"stx":"html","a":{"style":"background:blue"},"sa":{"style":"<nowiki>background:blue</nowiki>"}}'></div>
+<div style="background:blue" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"background:blue"},"sa":{"style":"<nowiki>background:blue</nowiki>"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[12,44,8,9]}'>background:blue</span>"}]]}'></div>
!! end
!! test
<div style="/* insecure input */"></div>
!! html/parsoid
-<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"<nowiki>border-left:expression(alert(document.cookie))</nowiki>"}}'></div>
+<div style="/* insecure input */" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"<nowiki>border-left:expression(alert(document.cookie))</nowiki>"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"<span typeof=\"mw:Nowiki\" data-parsoid='{\"dsr\":[12,75,8,9]}'>border-left:expression(alert(document.cookie))</span>"}]]}'></div>
!! end
# More MSIE fun discovered by Tom Gilder