</p>
!! end
-# Note that the html+tidy output removes the spaces after the <li>,
-# which is a bug (https://sourceforge.net/p/tidy/bugs/945/, etc).
-# This is an issue for all tests with lists. We intentionally do
-# *not* add html+tidy clauses for these, as we don't want to
-# document/test the broken behavior. (Parsoid matches the non-tidy
-# output in these cases.)
-
!! test
Simple list
!! wikitext
!! end
!! test
-Parsoid only: Quote balancing context should be restricted to td/th cells on the same wikitext line
-(Requires tidy for PHP parser output to be fixed up)
+Quote balancing context should be restricted to td/th cells on the same wikitext line
!! options
parsoid=wt2html,wt2wt
!! wikitext
!''a!!''b
|''a||''b
|}
-!! html/php+tidy
+!! html+tidy
<table>
-<tr>
+<tbody><tr>
<th><i>a</i></th>
-<th><i>b</i></th>
+<th><i>b</i>
+</th>
<td><i>a</i></td>
-<td><i>b</i></td>
-</tr>
-</table>
-!! html/parsoid
-<table>
-<tbody><tr><th><i>a</i></th><th><i>b</i></th>
-<td><i>a</i></td><td><i>b</i></td></tr>
-</tbody></table>
+<td><i>b</i>
+</td></tr></tbody></table>
!! end
###
</p>
!! end
-# There is a tidy bug here: https://sourceforge.net/p/tidy/bugs/946/
-# If the non-word-character tag made it through the sanitizer, tidy
-# would munge it up.
!! test
-Non-word characters don't terminate tag names + tidy
+Non-word characters don't terminate tag names
!! wikitext
<blockquote|>a</blockquote>
<sub-ID#1>
!! html+tidy
-<p><blockquote|>a</p>
-<p><b→> doesn't terminate </b→></p>
-<p><bä> doesn't terminate </bä></p>
-<p><boo> doesn't terminate </boo></p>
-<p><s.foo> doesn't terminate </s.foo></p>
-<p><sub-ID#1></p>
+<p><blockquote|>a
+</p><p><b→> doesn't terminate </b→>
+</p><p><bä> doesn't terminate </bä>
+</p><p><boo> doesn't terminate </boo>
+</p><p><s.foo> doesn't terminate </s.foo>
+</p><p><sub-ID#1>
+</p>
!! end
###
<s.foo>s</s>
!! html/php+tidy
-<p><s.foo>s</p>
+<p class="mw-empty-elt">
+</p><p><s.foo>s
+</p>
!! html/parsoid
<p><s.foo>s</p>
!! end
!! wikitext
{{echo|–}}
!! html/php+tidy
-<p>–</p>
+<p>–
+</p>
!! html/parsoid
<p><span typeof="mw:Transclusion mw:Entity" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"&ndash;"}},"i":0}}]}'>–</span></p>
!! end
<p>b
</p>
!! html+tidy
-<p>a</p>
-<div>foo</div>
-<p>b</p>
+<p>a </p><div>foo</div>
+<p>b
+</p>
!! end
+# Remex wraps empty tag runs with p-tags.
+# Parsoid strips them out during p-wrapping.
!! test
No p-wrappable content
!! wikitext
<span><div>x</div></span>
<span><s><div>x</div></s></span>
<small><em></em></small><span><s><div>x</div></s></span>
-!! html+tidy
-<div><span>x</span></div>
-<div><span><s>x</s></span></div>
-<div><span><s>x</s></span></div>
+!! html/php+tidy
+<span><div>x</div></span>
+<span><s><div>x</div></s></span>
+<p><small><em></em></small></p><span><s><div>x</div></s></span>
!! html/parsoid
<span><div>x</div></span>
<span><s><div>x</div></s></span>
<p>b
</p>
!! html+tidy
-<p>a</p>
-<blockquote>
-<p>foo</p>
-</blockquote>
-<p>b</p>
+<p>a </p><blockquote><p>foo</p></blockquote>
+<p>b
+</p>
!! end
!! test
b <div>foo</div>
!! html+tidy
-<p>a</p>
-<div>foo</div>
-<p>b</p>
-<div>foo</div>
+<p>a </p><div>foo</div><p>
+b </p><div>foo</div>
!! end
!! test
b <blockquote>foo</blockquote>
!! html+tidy
-<p>a</p>
-<blockquote>
-<p>foo</p>
-</blockquote>
-<p>b</p>
-<blockquote>
-<p>foo</p>
-</blockquote>
+<p>a </p><blockquote><p>foo</p></blockquote><p>
+b </p><blockquote><p>foo</p></blockquote>
!! end
!! test
x <div>foo</div> z
!! html+tidy
-<div>foo</div>
-<p>a</p>
-<p>b c d e</p>
-<p>x</p>
-<div>foo</div>
-<p>z</p>
+<div>foo</div><p> a
+</p><p>b
+c
+d e
+</p><p>
+x </p><div>foo</div><p> z
+</p>
!! end
-# Tidy strips out the empty <div> tags. Parsoid doesn't.
-# So, we have a separate section for Parsoid. We don't want
-# to mimic this stripping behavior in Parsoid. It affects
-# editing experience and also requires us to maintain additional
-# info for RT-ing.
+# The difference between Parsoid & Remex here
+# is because of Parsoid's Tidy-emulation code
+# for p-wrapping. We'll start work to remove this
+# emulation code in Parsoid sooner than later.
+# Remex wraps empty tag runs with p-tags.
+# Parsoid strips them out in a separate pass.
!! test
Empty lines between lines with block tags
!! wikitext
<div>e</div>
!! html+tidy
-<p><br /></p>
-<p>a</p>
-<p>b</p>
-<div>a</div>
-<p>b</p>
-<div>b</div>
-<p>d</p>
-<p><br /></p>
+<div></div>
+<p><br />
+</p>
+<div></div><p>a
+</p><p>b
+</p>
+<div>a</div><p>b
+</p><div>b</div><p>d
+</p><p><br />
+</p>
<div>e</div>
!! html/parsoid
<div data-parsoid='{"stx":"html"}'></div>
<div data-parsoid='{"stx":"html"}'>e</div>
!! end
-## PHP parser emits output which is broken
!! test
Unclosed HTML p-tags should be handled properly
!! wikitext
b
!! html/php+tidy
-<div>
-<p>foo</p>
-</div>
-<p>a</p>
-<p>b</p>
+<div><p>foo</p></div>
+<p>a
+</p><p>b
+</p>
!! html/parsoid
<div data-parsoid='{"stx":"html"}'><p data-parsoid='{"stx":"html", "autoInsertedEnd":true}'>foo</p></div>
<p>a</p>
!! end
-# Note that the p-wrapping is newline sensitive, which could be
-# considered a bug: tidy will wrap only the 'Foo' in the example
-# below in a <p> tag. (see comment 23-25 of T8200)
!! test
T17491: <ins>/<del> in blockquote (2)
!! wikitext
</blockquote>
!! html+tidy
-<blockquote>
-<p>Foo</p>
-<del>bar</del> <ins>baz</ins> quux</blockquote>
+<blockquote><p>Foo </p><del>bar</del> <ins>baz</ins><p> quux
+</p></blockquote>
!! end
!! test
</p>
!! end
-# Parsoid doesn't strip empty tags, like Tidy does.
!! test
Empty pre; pre inside other HTML tags (T56946)
!! wikitext
foo
</pre></div>
<pre></pre>
-!! html/php
+!! html/php+tidy
<p>a
</p>
-<div><pre>
-foo
+<div><pre>foo
</pre></div>
<pre></pre>
-
-!! html/php+tidy
-<p>a</p>
-<div>
-<pre>
-foo
-</pre></div>
!! html/parsoid
<p>a</p>
</pre>
!! end
-# Note that tidy removes the empty <p> tags from the start and end.
-# Parsoid does not, by design.
!! test
Block tag pre
!! wikitext
<p><pre>foo</pre></p>
!! html/php+tidy
-<pre>
-foo
-</pre>
+<p class="mw-empty-elt"></p><pre>foo</pre><p class="mw-empty-elt"></p>
!! html/parsoid
<p class='mw-empty-elt' data-parsoid='{"stx":"html","autoInsertedEnd":true}'></p><pre typeof="mw:Extension/pre" about="#mwt2" data-parsoid='{"stx":"html"}' data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"foo"}}'>foo</pre><p class='mw-empty-elt' data-parsoid='{"autoInsertedStart":true,"stx":"html"}'></p>
!! end
<table><pre </table>
!! html/php+tidy
-<pre>
-x
-</pre>
-<p><pre</p>
+<pre>x</pre>
+<pre <table></table>
!! html/parsoid
<pre about="#mwt1" typeof="mw:Transclusion mw:Extension/pre" data-parsoid='{"a":{"<pre":null},"sa":{"<pre":""},"stx":"html","pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<pre <pre>x</pre>"}},"i":0}}]}'>x</pre>
!! wikitext
{{echo|[foo]|{{echo|[bar]}}}}
!! html/php+tidy
-<p>[foo]</p>
+<p>[foo]
+</p>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion"
data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[foo]"},"2":{"wt":"{{echo|[bar]}}"}},"i":0}}]}'>[foo]</p>
!! wikitext
{{echo|[{{echo|http://example.com}} link]}}
!! html/php+tidy
-<p><a rel="nofollow" class="external text" href="http://example.com">link</a></p>
+<p><a rel="nofollow" class="external text" href="http://example.com">link</a>
+</p>
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://example.com" about="#mwt31" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[{{echo|http://example.com}} link]"}},"i":0}}]}'>link</a></p>
!! end
!! wikitext
{{echo|http://foo.com/a|b}}
!! html/php+tidy
-<p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a></p>
+<p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a>
+</p>
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://foo.com/a%7Cb" about="#mwt1"
typeof="mw:Transclusion"
!! wikitext
{{echo|[http://foo.com/a|b a|b]}}
!! html/php+tidy
-<p><a rel="nofollow" class="external text" href="http://foo.com/a%7Cb">a|b</a></p>
+<p><a rel="nofollow" class="external text" href="http://foo.com/a%7Cb">a|b</a>
+</p>
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
typeof="mw:Transclusion"
{{echo|<nowiki><div></nowiki>}}
{{echo|<nowiki></nowiki>}}
!! html/php+tidy
-<p>foo|bar <div></p>
+<p>foo|bar
+<div>
+
+</p>
!! html/parsoid
<p><span about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"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='{"parts":[{"template":{"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>
!! wikitext
{{echo|{{echo|1=bar}}}}
!! html/php+tidy
-<p>bar</p>
+<p>bar
+</p>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{echo|1=bar}}"}},"i":0}}]}'>bar</p>
!! end
!! wikitext
{{echo|a : b}}
!! html/php+tidy
-<p>a : b</p>
+<p>a : b
+</p>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a : b"}},"i":0}}]}'>a<span typeof="mw:DisplaySpace mw:Placeholder" data-parsoid='{"isDisplayHack":true}'> </span>: b</p>
!! end
!! wikitext
{{echo|=foo}}
!! html/php+tidy
-<p>{{{1}}}</p>
+<p>{{{1}}}
+</p>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p>
!! end
!! wikitext
{{blank_param|bar|=foo}}
!! html/php+tidy
-<p>bar foo</p>
+<p>bar
+foo
+</p>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"},{"k":"","named":true}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"blank_param","href":"./Template:Blank_param"},"params":{"1":{"wt":"bar"},"":{"wt":"foo"}},"i":0}}]}'>bar
foo</p>
<p>c </p><blockquote data-parsoid='{"stx":"html"}'> foo </blockquote>
<pre><span> foo </span>
</pre>
-!! html+tidy
-<p>a</p>
-<p>foo</p>
-<p>b</p>
-<div>foo</div>
-<p>c</p>
-<blockquote>
-<p>foo</p>
-</blockquote>
-<pre>
-<span> foo </span>
+!! html/php+tidy
+<p> a </p><p> foo </p><p>
+ b </p><div> foo </div><p>
+ c </p><blockquote><p> foo </p></blockquote>
+<pre><span> foo </span>
</pre>
!! end
!! html/parsoid
<pre>a <span data-parsoid='{"stx":"html"}'>foo</span></pre>
b <div data-parsoid='{"stx":"html"}'> foo </div>
-!! html+tidy
-<pre>
-a <span>foo</span>
-</pre>
-<p>b</p>
-<div>foo</div>
+!! html/php+tidy
+<pre>a <span>foo</span>
+</pre><p>
+ b </p><div> foo </div>
!!end
!!test
foo
--> b
!! html/php+tidy
-<p>a b</p>
+<p>a b
+</p>
!! html/parsoid
<p>a <!--
foo
foo
</pre>
!! html/php+tidy
-<pre>
-foo
-</pre>
-<pre>
-foo
+<pre>foo</pre>
+<pre>foo
</pre>
<pre>
!! wikitext
;one</b>two : bad tag fun
!! html/php+tidy
-<dl>
-<dt>onetwo </dt>
-<dd>bad tag fun</dd>
-</dl>
+<dl><dt>onetwo </dt>
+<dd> bad tag fun</dd></dl>
!! html/parsoid
<dl>
<dt>onetwo</dt>
!! test
Definition Lists: Nesting: Multi-level (Parsoid only)
-!! options
-parsoid
!! wikitext
;t1 :d1
;;t2 ::d2
;;;t3 :::d3
-!! html
+!! html/parsoid
<dl>
<dt>t1 </dt>
<dd>d1</dd>
!! test
-Definition Lists: Nesting: Test 2 (Parsoid only)
+Definition Lists: Nesting: Test 2
!! wikitext
;t1
::d2
-!! html/php+tidy
-<dl>
-<dt>t1</dt>
+!! html+tidy
+<dl><dt>t1</dt>
<dd>
-<dl>
-<dd>d2</dd>
-</dl>
-</dd>
-</dl>
-!! html/parsoid
-<dl>
- <dt>t1</dt>
- <dd>
- <dl>
- <dd>d2</dd>
- </dl>
- </dd>
-</dl>
-
+<dl><dd>d2</dd></dl></dd></dl>
!! end
!! test
-Definition Lists: Nesting: Test 3 (Parsoid only)
+Definition Lists: Nesting: Test 3
!! wikitext
:;t1
::::d2
-!! html/php+tidy
-<dl>
-<dd>
-<dl>
-<dt>t1</dt>
-<dd>
-<dl>
+!! html+tidy
+<dl><dd><dl><dt>t1</dt>
<dd>
-<dl>
-<dd>d2</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-</dl>
-!! html/parsoid
-<dl>
- <dd>
- <dl>
- <dt>t1</dt>
- <dd>
- <dl>
- <dd>
- <dl>
- <dd>d2</dd>
- </dl>
- </dd>
- </dl>
- </dd>
- </dl>
- </dd>
-</dl>
-
+<dl><dd><dl><dd>d2</dd></dl></dd></dl></dd></dl></dd></dl>
!! end
<dl><dt> baz</dt></dl></dd></dl>
!! html/php+tidy
-<dl>
-<dd>
-<dl>
-<dd>
-<ul>
-<li>foo</li>
-<li>bar</li>
-</ul>
-</dd>
-</dl>
-<dl>
-<dt>baz</dt>
-</dl>
-</dd>
-</dl>
+<dl><dd><dl><dt><ul><li> foo</li>
+<li> bar</li></ul></dt></dl>
+<dl><dt> baz</dt></dl></dd></dl>
!! html/parsoid
<dl>
<dd><dl>
!! end
+# The Parsoid team disagrees with the PHP parser's seemingly-random
+# rules regarding dd/dt on the next few tests. Parsoid is more
+# consistent, and recognizes the shared nesting and keeps the
+# still-open tags around until the nesting is complete.
+
# This is a regression test for T175099
-# html/php+tidy is insufficient since Tidy covers up the bug.
-# But once Tidy is replaced with RemexHTML, html/php+tidy is good enough
!! test
Definition Lists: Mixed Lists: Test 11
!! wikitext
-; a
-:* b
-!! html/*
-<dl><dt> a</dt>
+;a
+:*b
+!! html/php
+<dl><dt>a</dt>
<dd>
-<ul><li> b</li></ul></dd></dl>
+<ul><li>b</li></ul></dd></dl>
+!! html/parsoid
+<dl><dt>a
+<dd><ul><li>b</li></ul></dd></dl>
!! end
-# The Parsoid team disagrees with the PHP parser's seemingly-random
-# rules regarding dd/dt on the next two tests. Parsoid is more
-# consistent, and recognizes the shared nesting and keeps the
-# still-open tags around until the nesting is complete.
-# (And tidy again converts <dt> to <dd> before 'bar'.)
-
+# FIXME: Maybe get rid of this test?
!! test
Definition Lists: Mixed Lists: Test 12
!! wikitext
<dd>baz</dd></dl></li></ol></li></ul></li></ol></li></ul>
!! html/php+tidy
-<ul>
-<li>
-<ol>
-<li>
-<ul>
-<li>
-<ol>
-<li>
-<dl>
-<dt>foo </dt>
-<dd>
-<ul>
-<li>
-<dl>
-<dd>
-<dl>
-<dt>bar</dt>
-</dl>
-</dd>
-</dl>
-</li>
-</ul>
-</dd>
-</dl>
-<dl>
-<dt>boo </dt>
-<dd>baz</dd>
-</dl>
-</li>
-</ol>
-</li>
-</ul>
-</li>
-</ol>
-</li>
-</ul>
+<ul><li><ol><li><ul><li><ol><li><dl><dt>foo </dt>
+<dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dt></dl></li></ul></dd></dl></li></ol></li></ul>
+<dl><dt>boo </dt>
+<dd>baz</dd></dl></li></ol></li></ul>
!! html/parsoid
<ul>
<li>
</ul>
!! end
-
-# Another case where tidy converts a <dt> to a <dd> (but Parsoid doesn't).
+# FIXME: Maybe get rid of this test?
# From whitelist:
# * The test is wrong, there are two colons where there should be :;
# * The PHP parser is wrong to close the <dl> after the <dt> containing the <ul>.
Definition Lists: Weird Ones: Test 1
!! wikitext
*#;*::;; foo : bar (who uses this?)
-!! html/php
-<ul><li><ol><li><dl><dt> foo </dt>
-<dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)</dt></dl></dd></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul>
-
!! html/php+tidy
-<ul>
-<li>
-<ol>
-<li>
-<dl>
-<dt>foo </dt>
-<dd>
-<ul>
-<li>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dt>bar (who uses this?)</dt>
-</dl>
-</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-</dl>
-</li>
-</ul>
-</dd>
-</dl>
-</li>
-</ol>
-</li>
-</ul>
+<ul><li><ol><li><dl><dt> foo </dt>
+<dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt> bar (who uses this?)</dt></dl></dt></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul>
!! html/parsoid
<ul>
<li>
;{{echo|''a:b''}}
;;;''a:b''
!! html+tidy
-<dl>
-<dt>a</dt>
+<dl><dt>a</dt>
<dd>b</dd>
<dt><b>a:b</b></dt>
<dt><i>a:b</i></dt>
<dt><span>a:b</span></dt>
-<dd>
-<div>a:b</div>
-</dd>
-<dd>
-<div>a
-<dl>
+<dt><div>a:b</div></dt>
+<dt><div>a</div></dt>
<dd>b</dd>
-</dl>
-</div>
-</dd>
<dt>a</dt>
<dd>b</dd>
-<dt><i>a:b</i></dt>
-</dl>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dt><i>a:b</i></dt>
-</dl>
-</dd>
-</dl>
-</dd>
-</dl>
+<dt><i>a:b</i></dt></dl>
+<dl><dt><dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl>
!! html/parsoid
<dl><dt>a</dt><dd data-parsoid='{"stx":"row"}'>b</dd>
<dt><b>a:b</b></dt>
<dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl>
!! end
+# Parsoid's output differs here again because it shares
+# nesting between the two lists unlike the PHP parser.
+# Unsure which is more desirable.
!! test
Definition Lists: colons and tables 1
!! wikitext
:{|
| y
|}
-!! html
+!! html/php
<dl><dd><table>
<tr>
<td> x
<td> y
</td></tr></table></dd></dl>
-!! end
-
-# Parsoid's output (as documented below) differs from php's in this case.
-# This is probably a bug. If we fixup parsoid to match php's output, the
-# above test should pass and the below test case can be removed. It is
-# unclear which output is more desirable.
-
-!! test
-Definition Lists: colons and tables 2
-!! wikitext
-:{|
-| x
-|}
-:{|
-| y
-|}
!! html/parsoid
<dl><dd><table>
<tr>
</td></tr></table></dd></dl>
!! end
+# FIXME: Does this need a html/php section?
!! test
Definition Lists: template interaction
!! wikitext
</p>
!! end
+# Don't add the html/php section since the output is broken and there isn't any reason to spec it
!! test
External link containing double-single-quotes with no space separating the url from text in italics
!! wikitext
[http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
-!! html/php
-<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&action=edit&redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</a>
-</p>
!! html/php+tidy
-<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de</a> <a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&action=edit&redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.</p>
+<p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a href="/index.php?title=Museo_Picasso_(Par%C3%ADs)&action=edit&redlink=1" class="new" title="Museo Picasso (París) (page does not exist)">Museo Picasso</a>.
+</p>
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a rel="mw:WikiLink" href="./Museo_Picasso_(París)" title="Museo Picasso (París)">Museo Picasso</a><span>.</span></p>
!! end
!a
<tr><td>b!!c</td></tr>
|}
-!! html+tidy
+!! html/php+tidy
<table>
-<tr>
-<th>a</th>
-</tr>
-<tr>
-<td>b!!c</td>
-</tr>
-</table>
+<tbody><tr>
+<th>a
+</th></tr><tr><td>b!!c</td></tr>
+</tbody></table>
!! html/parsoid
<table>
<tbody><tr><th>a</th></tr>
|}
!! html/php+tidy
<table>
-<tr>
-<td>x</td>
-</tr>
-</table>
+
+<tbody><tr>
+<td> x
+</td></tr></tbody></table>
!! html/parsoid
<table><!--c1--><!--c2-->
<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'><!--c3-->
!! end
!! test
-Implicit <td> after a |-
+Fostered content in tables: Plain text
!! options
parsoid=wt2html,html2html
!! wikitext
</table>
!! html/php+tidy
-<p>a</p>
+
+
+a
+<table></table>
!! html/parsoid
<p data-parsoid='{"fostered":true,"autoInsertedEnd":true}'>a</p><table>
<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'>
!! end
!! test
-Lists should be recognized in an implicit <td> context
+Fostered content in tables: Lists
!! options
parsoid=wt2html,html2html
!! wikitext
</table>
!! html/php+tidy
-<ul>
-<li>a</li>
-</ul>
+<ul><li>a</li></ul><table>
+
+
+</table>
!! html/parsoid
<ul data-parsoid='{"fostered":true,"autoInsertedEnd":true}'><li>a</li></ul><table>
<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'>
!! end
!! test
-Table cells not properly parsed in an implicit-td context
+Template generated table cell with attributes
!! wikitext
{|
|-
|}
!! html/php+tidy
<table>
-<tr>
-<td style="background-color:#DC241f;" width="10px"></td>
-<td>a</td>
-<td>b</td>
-</tr>
-</table>
+
+<tbody><tr>
+<td style="background-color:#DC241f;" width="10px"> </td>
+<td> a </td>
+<td> b
+</td></tr></tbody></table>
!! html/parsoid
<table>
<tbody><tr data-parsoid='{"startTagSrc":"|-","autoInsertedEnd":true}'>
|}<b>quux</b>
!! html+tidy
<table>
-<tr>
-<td>foo</td>
-</tr>
-</table>
-<p>bar</p>
-<table>
-<tr>
-<td>baz</td>
-</tr>
-</table>
-<p><b>quux</b></p>
+<tbody><tr>
+<td>foo
+</td></tr></tbody></table><p> bar
+</p><table>
+<tbody><tr>
+<td>baz
+</td></tr></tbody></table><p><b>quux</b>
+</p>
!! end
!! test
|}
!!html/php+tidy
<table class="foo">
-<tr>
+<tbody><tr>
<td class="bar">
-<p>foo</p>
-</td>
-</tr>
-</table>
+<p>foo
+</p>
+</td></tr></tbody></table>
!!html/parsoid
<table class="foo">
<tr>
|}
!! html/php+tidy
<table>
-<caption>Test</caption>
-<tr>
-<th>Month</th>
-<th>Savings</th>
-</tr>
+<caption>Test
+</caption>
+<tbody><tr>
+<th>Month
+</th>
+<th>Savings
+</th></tr>
<tr>
-<td>January</td>
-<td>$100</td>
-</tr>
+<td>January
+</td>
+<td>$100
+</td></tr>
<tr>
-<td>February</td>
-<td>$80</td>
-</tr>
+<td>February
+</td>
+<td>$80
+</td></tr>
<tr>
-<td>Sum</td>
-<td>$180</td>
-</tr>
-</table>
+<td>Sum
+</td>
+<td>$180
+</td></tr></tbody></table>
!! end
# T137406: No whitespace in the HTML
title=[[Bug462]]
!! wikitext
[[Bug462]] [[Bug462]]
-!! html/php
+!! html/php+tidy
<p><a class="mw-selflink selflink">Bug462</a> <a class="mw-selflink selflink">Bug462</a>
</p>
-!! html/php+tidy
-<p><a class="mw-selflink selflink">Bug462</a> <a class="mw-selflink selflink">Bug462</a></p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Bug462" title="Bug462">Bug462</a> <a rel="mw:WikiLink" href="./Bug462" title="Bug462">Bug462</a></p>
!! end
<ul><li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
<li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li></ul>
-!! html+tidy
+!! html/php+tidy
<ul>
<li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
<li><a href="http://en.wikipedia.org/wiki/ro:Olteni%C5%A3a" class="extiw" title="wikipedia:ro:Olteniţa">Wikipedia:ro:Olteniţa</a></li>
<br/ >
!! html+tidy
-<p><br /></p>
-<p><br /></p>
+<p><br />
+</p><p><br />
+</p>
!! end
!! test
> bar
!! html+tidy
<hr />
-<hr />
-<p>foo</p>
-<hr />
-<p>bar</p>
+<hr /><p>
+foo </p><hr /><p> bar
+</p>
!! end
!! test
<hr /> Foo
!! html+tidy
-<hr />
-<p>Foo</p>
+<hr /><p> Foo
+</p>
!! end
###
</li>
!! html+tidy
-<ul>
-<li>a</li>
-<li>b</li>
-<li>c</li>
-</ul>
+<li>a
+</li><li>b
+</li><li>c
+</li>
!!end
!!test
!!end
+# FIXME: Parsoid has a dedicated DOM pass to mimic this Tidy-specific li-hack
+# That pass could possibly be removed.
!!test
-Test the li-hack
-(The PHP parser relies on Tidy for the hack)
+Test the li-hack (a hack from Tidy days, but doesn't work as advertised with Remex)
!!options
parsoid=wt2html,wt2wt
!! wikitext
</li>
</ul>
!! html+tidy
+<ul><li> foo</li>
+<li class="mw-empty-elt"> </li><li>li-hack</li>
+<li class="mw-empty-elt"> </li><li>templated li-hack</li>
+<li class="mw-empty-elt"> </li><li> unsupported li-hack with preceding comments</li></ul>
<ul>
-<li>foo</li>
-<li>li-hack</li>
-<li>templated li-hack</li>
-<li>unsupported li-hack with preceding comments</li>
-</ul>
-<ul>
-<li>not a li-hack</li>
+<li class="mw-empty-elt"></li><li>not a li-hack
+</li>
</ul>
!! html/parsoid
<ul><li> foo</li>
# tags (parse, minimize scope of fixup, and roundtrip back)
# ------------------------------------------------------------------------
+# Remex and Parsoid output stems from list handling diffs because Parsoid & PHP parser.
+# Parsoid's list handling is more aware of block structure.
!! test
Unbalanced closing block tags break a list
-(php parser relies on Tidy to fix up)
!! wikitext
<div>
*a</div><div>
*b</div>
!! html+tidy
<div>
-<ul>
+<ul><li>a</li></ul></div><div>
+<li>b</li></div>
+!! html+parsoid
+<div><ul>
<li>a</li>
-</ul>
-</div>
-<div>
-<ul>
+</ul></div>
+<div><ul>
<li>b</li>
-</ul>
-</div>
+</ul></div>
!! end
-# Parsoid fails this test, but it might be tricky to support properly.
-# See T70395.
!! test
Unbalanced closing non-block tags don't break a list
-(php parser relies on Tidy to fix up)
!! wikitext
<span>
*a</span><span>
*b</span>
!! html/php+tidy
-<ul>
-<li><span>a</span></li>
-<li><span>b</span></li>
-</ul>
+<p><span>
+</span></p>
+<ul><li>a<span></span></li>
+<li>b</li></ul>
!! html/parsoid
<span>
<ul>
-<li>a<span></span>
-</li>
-<li>b
-</li>
+<li>a<span></span></li>
+<li>b</li>
</ul>
</span>
!! end
+# Parsoid does some post-dom-building cleanup
+# which is why its output differs from Remex.
!! test
Unclosed formatting tags that straddle lists are closed and reopened
-(php parser relies on Tidy to fix up)
!! options
parsoid=wt2html,wt2wt,html2html
!! wikitext
# <s> a
# b </s>
!! html/php+tidy
-<ol>
-<li><s>a</s></li>
-<li><s>b</s></li>
-</ol>
+<ol><li> <s> a</s></li><s>
+</s><li><s> b </s></li></ol>
!! html/parsoid
-<ol><li> <s> a</s></li>
+<ol><li> <s> a</s><s></s></li>
<li><s> b </s></li></ol>
!! end
+# Output is ugly because of all the misnested tag fixups.
+# Remex is wrapping p-tags around empty elements.
+# Parsoid has special-case handling of this pattern of
+# wrapping lists in formatting tags.
+# FIXME: Should we remove this code from Parsoid? Or add
+# special support in Remex? If the latter, maybe just wait
+# for Parsoid to become the default parser.
# See T70395.
!!test
1. List embedded in a formatting tag
* foo
</small>
!! html/php+tidy
-<ul>
-<li><small>foo</small></li>
-</ul>
+<p><small>
+</small></p><small><ul><li> foo</li></ul></small><small></small><p><small></small>
+</p>
!! html/parsoid
<small>
<ul>
</small>
!!end
-## Ugly Parsoid output here
-## Not sure what the right output is.
+# Output is ugly because of all the misnested tag fixups
+# Remex is wrapping p-tags around empty elements.
+# Parsoid has code that strips useless p-tags.
!!test
-2. List embedded in a formatting tag
+2. List embedded in a formatting tag in a misnested way
!! wikitext
<small>
*a
*b</small>
!! html/php+tidy
-<ul>
-<li><small>a</small></li>
-<li><small>b</small></li>
-</ul>
+<p><small>
+</small></p><small></small><ul><small><li>a</li>
+</small><li><small>b</small></li></ul>
!! html/parsoid
<small></small>
<ul><small>
</ul>
!!end
-# Ugly Parsoid and PHP parser output here
-# Not sure if we want to make this a test!
-#
-## !!test
-## 3. Unclosed formatting tags in list elements
-## !! wikitext
-## *<small>a
-## *<small>b
-## !! html/php+tidy
-## <ul>
-## <li><small>a</small></li>
-## <li><small><small>b</small></small></li>
-## </ul>
-## !! html/parsoid
-## <ul>
-## <li><small>a</small></li>
-## <small>
-## <li><small>b</small></li>
-## </small></ul>
-## !!end
-
-# This is a bug in the PHP parser + tidy combination.
-# (The </tr> tag gets parsed as text and html-escaped by PHP,
-# and then fostered out of the table by tidy.)
-# We believe the Parsoid output to be correct.
!! test
Table with missing opening <tr> tag
!! options
</table>
!! html+tidy
<table>
-<tr>
-<td>foo</td>
+<tbody><tr><td>foo</td>
</tr>
-</table>
+</tbody></table>
!! end
###
parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
''{{PAGENAME}}''
-!! html/php
+!! html+tidy
<p><i>'foo & bar = baz'</i>
</p>
-!! html+tidy
-<p><i>'foo & bar = baz'</i></p>
!! end
!! test
parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAME}}
-!! html/php
+!! html+tidy
<p>*RFC 1234 http://example.com/
</p>
-!! html+tidy
-<p>*RFC 1234 http://example.com/</p>
!! end
!! test
parsoid={ "modes": ["wt2html","wt2wt"], "normalizePhp": true }
!! wikitext
{{PAGENAMEE}}
-!! html/php
+!! html+tidy
<p>*RFC_1234_http://example.com/
</p>
-!! html+tidy
-<p>*RFC_1234_http://example.com/</p>
!! end
!! test
This is a test template with parameter <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
!! html+tidy
-<p>This is a test template with parameter</p>
-<div class="thumb tright">
-<div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a>
-<div class="thumbcaption"><a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">caption</a></div>
-</div>
-</div>
+<p>This is a test template with parameter </p><div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/index.php?title=Special:Upload&wpDestFile=Noimage.png" class="new" title="File:Noimage.png">File:Noimage.png</a> <div class="thumbcaption"><a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">link</a> <a href="/index.php?title=No_link&action=edit&redlink=1" class="new" title="No link (page does not exist)">caption</a></div></div></div>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"paramtest","href":"./Template:Paramtest"},"params":{"param":{"wt":"[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]"}},"i":0}}]}'>This is a test template with parameter </p><figure class="mw-default-size" typeof="mw:Error mw:Image/Thumb" about="#mwt1" data-mw='{"errors":[{"key":"apierror-filedoesnotexist","message":"This image does not exist."}]}'><a href="./File:Noimage.png" ><img resource="./File:Noimage.png" src="./Special:FilePath/Noimage.png" height="220" width="220"/></a><figcaption><a rel="mw:WikiLink" href="./No_link" title="No link">link</a> <a rel="mw:WikiLink" href="./No_link" title="No link">caption</a></figcaption></figure>
!! end
{{echo|{{!}}hi}}
|}
!! html/php+tidy
-<p>ha</p>
-<p>ho</p>
-<table>
-<tr>
-<td></td>
-</tr>
-<tr>
-<td>hi</td>
-</tr>
-</table>
-<table>
-<tr>
-<td></td>
-</tr>
-</table>
+<p>ha</p><table>
+
+</table><p>ho</p><table>
+
+<tbody><tr>
+<td>hi
+</td></tr></tbody></table>
!! html/parsoid
<p about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","autoInsertedEnd":true,"pi":[[{"k":"1"}],[{"k":"1"}],[{"k":"1"}]],"firstWikitextNode":"table"}' data-mw='{"parts":["{|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n<p>ha</p>"}},"i":0}},"\n","{|",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"\n<p>ho</p>"}},"i":1}},"\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"{{!}}hi"}},"i":2}},"\n|}"]}'>ha</p><table about="#mwt1" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"","html":""},{"html":""}]]}'>
{{echo|<tag>foo-{bar}bat</tag>}}
!! html/php+tidy
-<p>This form breaks the template, which is unfortunate:</p>
-<ul>
-<li>{{echo|foo-{bar}bat}}</li>
-</ul>
-<p>But if the broken language converter markup is inside an extension tag, nothing bad happens:</p>
-<ul>
-<li>foo-{bar}bat</li>
-<li>foo-{bar}bat</li>
-<li>
-<pre>
-foo-{bar}bat
-</pre></li>
-<li>
-<pre>
-foo-{bar}bat
-</pre></li>
-</ul>
-<pre>
-'foo-{bar}bat'
+<p>This form breaks the template, which is unfortunate:
+</p>
+<ul><li> {{echo|foo-{bar}bat}}</li></ul>
+<p>But if the broken language converter markup is inside an extension
+tag, nothing bad happens:
+</p>
+<ul><li> foo-{bar}bat</li>
+<li> foo-{bar}bat</li>
+<li> <pre>foo-{bar}bat</pre></li>
+<li> <pre>foo-{bar}bat</pre></li></ul>
+<pre>'foo-{bar}bat'
array (
)
</pre>
-<pre>
-'foo-{bar}bat'
+<pre>'foo-{bar}bat'
array (
)
</pre>
* [http://example.com Example in -{link} description]
* {{echo|[http://example.com/-{foo Breaks template, however]}}
!! html/php+tidy
-<ul>
-<li><a rel="nofollow" class="external text" href="http://example.com/-{foo">Example in URL</a></li>
-<li><a rel="nofollow" class="external text" href="http://example.com">Example in -{link} description</a></li>
-<li>{{echo|<a rel="nofollow" class="external text" href="http://example.com/-{foo">Breaks template, however</a>}}</li>
-</ul>
+<ul><li> <a rel="nofollow" class="external text" href="http://example.com/-{foo">Example in URL</a></li>
+<li> <a rel="nofollow" class="external text" href="http://example.com">Example in -{link} description</a></li>
+<li> {{echo|<a rel="nofollow" class="external text" href="http://example.com/-{foo">Breaks template, however</a>}}</li></ul>
!! html/parsoid
<ul>
<li><a rel="mw:ExtLink" href="http://example.com/-{foo">Example in URL</a></li>
* <!---{{foo}}--> ...extra dashes
* {{echo|foo<!-- -{bar} -->bat}} ...should be ok
!! html/php+tidy
-<ul>
-<li>...should be ok</li>
-<li>...extra dashes</li>
-<li>foobat ...should be ok</li>
-</ul>
+<ul><li> ...should be ok</li>
+<li> ...extra dashes</li>
+<li> foobat ...should be ok</li></ul>
!! html/parsoid
<ul>
<li><!--{{foo}}--> ...should be ok</li>
6
!! html/php+tidy
<h3><span id="1_foo.5Bbar_1"></span><span class="mw-headline" id="1_foo[bar_1">1 foo[bar 1</span></h3>
-<p>1</p>
+<p>1
+</p>
<h3><span id="2_foo.5B.5Bbar_2"></span><span class="mw-headline" id="2_foo[[bar_2">2 foo[[bar 2</span></h3>
-<p>2</p>
+<p>2
+</p>
<h3><span id="3_foo.7Bbar_3"></span><span class="mw-headline" id="3_foo{bar_3">3 foo{bar 3</span></h3>
-<p>3</p>
+<p>3
+</p>
<h3><span id="4_foo.7B.7Bbar_4"></span><span class="mw-headline" id="4_foo{{bar_4">4 foo{{bar 4</span></h3>
-<p>4</p>
+<p>4
+</p>
<h3><span id="5_foo.7B.7B.7Bbar_5"></span><span class="mw-headline" id="5_foo{{{bar_5">5 foo{{{bar 5</span></h3>
-<p>5</p>
+<p>5
+</p>
<h3><span id="6_foo-.7Bbar_6"></span><span class="mw-headline" id="6_foo-{bar_6">6 foo-{bar 6</span></h3>
-<p>6</p>
+<p>6
+</p>
!! html/parsoid
<meta property="mw:PageProp/notoc"/> <meta property="mw:PageProp/noeditsection"/>
<h3 id="1_foo[bar_1"><span id="1_foo.5Bbar_1" typeof="mw:FallbackId"></span>1 foo[bar 1</h3>
!! html+tidy
<div>Foo</div>
-<blockquote>
-<p>Foo</p>
-</blockquote>
+<blockquote><p>Foo</p></blockquote>
!!end
!!test
bar <div>baz</div>
!! html+tidy
-<p>Foo</p>
-<p>bar</p>
-<div>baz</div>
+<p>Foo
+</p><p>
+bar </p><div>baz</div>
!! end
!!test
<tr><td></td></tr></table>
!! html+tidy
-<p>a</p>
-<table>
-<tr>
-<td></td>
-</tr>
-</table>
+
+a
+<table><tbody><tr><td></td></tr></tbody></table>
!! end
!!test
</div>
<tr><td></td></tr></table>
-!! html+tidy
+!! html/php+tidy
<div>
+<p>foo
+</p>
+</div><table>
+
+<tbody><tr><td></td></tr></tbody></table>
+!! html/parsoid
+<div about="#mwt3" typeof="mw:Transclusion" data-parsoid='{"stx":"html","fostered":true,"autoInsertedEnd":true,"firstWikitextNode":"TABLE","pi":[[{"k":"1"}],[{"k":"1"}]]}' data-mw='{"parts":["{|\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"<div>"}},"i":0}},"\nfoo\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"</div>"}},"i":1}},"\n|}"]}'>
<p>foo</p>
-</div>
-<table>
-<tr>
-<td></td>
-</tr>
+</div><table about="#mwt3">
+
</table>
!! end
<div>b</div>
<tr><td></td></tr></table>
-!! html+tidy
-<p>a</p>
-<div>b</div>
-<table>
-<tr>
-<td></td>
-</tr>
+!! html/php+tidy
+
+a
+<div>b</div><table>
+<tbody><tr><td></td></tr></tbody></table>
+!! html/parsoid
+<p about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"fostered":true,"autoInsertedEnd":true,"firstWikitextNode":"TABLE","pi":[[{"k":"1"}]]}' data-mw='{"parts":["{|\n",{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a\n<div>b</div>"}},"i":0}},"\n|}"]}'>a</p><div about="#mwt2">b</div><table about="#mwt2">
+
+
</table>
!! end
a<div>bc</div>de
!! html+tidy
-<p>a</p>
-<div>bc</div>
-<p>de</p>
+<p>a</p><div>bc</div><p>de
+</p>
!! end
!!test
123<div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div>456
!! html/php+tidy
-<p>123<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>456</p>
-<p>123</p>
-<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div>
-<p>456 123</p>
-<div class="thumb tright">
-<div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>
-</div>
-</div>
-</div>
-<p>456</p>
+<p>123<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>456
+</p><p>
+123</p><div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a></div><p>456
+123</p><div class="thumb tright"><div class="thumbinner" style="width:222px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div></div></div></div><p>456
+</p>
!! html/parsoid
<p>123<figure-inline class="mw-default-size" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></figure-inline>456</p>
<p>123</p><figure class="mw-default-size mw-halign-right" typeof="mw:Image"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></figure><p>456</p>
text with character entity: eacute
!! wikitext
I always thought é was a cute letter.
-!! html
+!! html+tidy
<p>I always thought é was a cute letter.
</p>
-!! html+tidy
-<p>I always thought é was a cute letter.</p>
!! end
!! test
!! end
# This was T43545 in the PHP parser.
-# Note that tidy doesn't handle this correctly.
!! test
Nesting of <kbd>
!! wikitext
<kbd>X<kbd>Y</kbd>Z</kbd>
-!! html
+!! html+tidy
<p><kbd>X<kbd>Y</kbd>Z</kbd>
</p>
!! end
# Note that there are some other nestable tags (b, i, etc) which are
# not covered; see T53081 for discussion.
-# Note that tidy doesn't handle this correctly.
!! test
Nesting of <em>
!! wikitext
<em>X<em>Y</em>Z</em>
-!! html
+!! html+tidy
<p><em>X<em>Y</em>Z</em>
</p>
!! end
-# Note that tidy doesn't handle this correctly.
!! test
Nesting of <strong>
!! wikitext
<strong>X<strong>Y</strong>Z</strong>
-!! html
+!! html+tidy
<p><strong>X<strong>Y</strong>Z</strong>
</p>
!! end
!! wikitext
<q>X<q>Y</q>Z</q>
!! html+tidy
-<p><q>X<q>Y</q>Z</q></p>
+<p><q>X<q>Y</q>Z</q>
+</p>
!! end
-# Note that tidy doesn't handle this correctly.
!! test
Nesting of <ruby>
!! wikitext
</p>
!! end
-# Note that tidy doesn't handle this correctly.
!! test
Nesting of <bdo>
!! wikitext
# FIXME: this is still bad HTML tag nesting
# FIXME: doBlockLevels won't wrap this in a paragraph because it contains a div
+# Parsoid & Remex fix the p-wrapping since they operate on the DOM.
!! test
Media link with nasty text
!! wikitext
!! end
!! test
-Tags which are hidden from Tidy cannot pass through the Sanitizer
+Tags which are hidden from tidiers cannot pass through the Sanitizer
!! wikitext
<mw:toc><script>alert();</script></mw:toc>
!! html+tidy
-<p><mw:toc><script>alert();</script></mw:toc></p>
+<p><mw:toc><script>alert();</script></mw:toc>
+</p>
!! end
###
### Sanitizer
###
-# HTML+Tidy strips out empty tags completely. Parsoid doesn't.
-# FIXME: Wikitext for this first test doesn't match its title.
+# Remex wraps empty tag runs with p-tags.
+# Parsoid strips them out during p-wrapping.
!! test
Sanitizer: Closing of open tags
!! wikitext
<s></s><table></table>
!! html/php+tidy
-
+<p><s></s></p><table></table>
!! html/parsoid
<s></s><table></table>
!! end
!! wikitext
</s>
!! html/php+tidy
+<p class="mw-empty-elt">
+</p>
!! html/parsoid
!! end
parsoid=wt2html
!! wikitext
Table not started</td></tr></table>
-!! html/php+tidy
-<p>Table not started</p>
-!! html/parsoid
-<p>Table not started</p>
+!! html+tidy
+<p>Table not started
+</p>
!! end
!! test
<div><font id="bug2"></font>In div text</div>
!! end
-#
-#
-#
-
!! test
Punctuation: nbsp before exclamation
!! wikitext
</ul>
!! html/php+tidy
<ul>
-<li>One</li>
-<li>Two</li>
-</ul>
+<li>One
+</li><li>Two
+</li></ul>
!! html/parsoid
<ul data-parsoid='{"stx":"html"}'>
<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li>
</ol>
!! html/php+tidy
<ol>
-<li>One</li>
-<li>Two</li>
-</ol>
+<li>One
+</li><li>Two
+</li></ol>
!! html/parsoid
<ol data-parsoid='{"stx":"html"}'>
<li data-parsoid='{"stx":"html","autoInsertedEnd":true}'>One</li>
<li>Sub-two
</ul>
</ul>
-!! html/php+tidy
-<ul>
-<li>One</li>
-<li>Two:
-<ul>
-<li>Sub-one</li>
-<li>Sub-two</li>
-</ul>
-</li>
-</ul>
-!! html/parsoid
+!! html+tidy
<ul>
<li>One
-</li>
-<li>Two:
+</li><li>Two:
<ul>
<li>Sub-one
-</li>
-<li>Sub-two
-</li>
-</ul>
-</li>
-</ul>
-
+</li><li>Sub-two
+</li></ul>
+</li></ul>
!! end
!! test
!! html/php+tidy
-<h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<p>http://</p>
-<div id="toc" class="toc">
-<div class="toctitle" lang="en" dir="ltr" xml:lang="en">
-<h2>Contents</h2>
-</div>
+<h2><span class="mw-headline" id="onmouseover.3D">onmouseover=</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: onmouseover=">edit</a><span class="mw-editsection-bracket">]</span></span></h2><p>
+http://</p><div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
</ul>
</div>
-<p></p>
!! html/parsoid
<h2 id="onmouseover="><span id="onmouseover.3D" typeof="mw:FallbackId"></span> onmouseover= </h2>
<p><a rel="mw:ExtLink" href="http://__TOC__" data-parsoid='{"stx":"url"}'>http://__TOC__</a></p>
!! end
# Known to produce bogus xml (extra </td>)
+# Don't add the html/php section since it generates broken HTML
!! test
Fuzz testing: Parser16
!! wikitext
{|
!https://||||||
-!! html
+!! html+tidy
<table>
-<tr>
+<tbody><tr>
<th>https://</th>
<th></th>
<th></th>
<th>
-</td>
-</tr>
-</table>
-!! html+tidy
-<table>
-<tr>
-<th>https://</th>
-<th></th>
-<th></th>
-<th></th>
-</tr>
-</table>
+</th></tr>
+</tbody></table>
!! end
!! test
<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a><pre>junk</pre>
!! html/php+tidy
-<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></p>
-<pre>
-junk
-</pre>
+<p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></p><pre>junk</pre>
!! html/parsoid
<p><a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"stx":"url"}'>http://example.com</a></p><pre typeof="mw:Extension/pre" about="#mwt2" data-mw='{"name":"pre","attrs":{},"body":{"extsrc":"junk"}}'>junk</pre>
!! end
!! html/php
<p>JavaScript
</p>
-!! html/php+tidy
-<p>JavaScript</p>
!! html/parsoid
<p><span typeof="mw:Entity">J</span><span typeof="mw:Entity">a</span><span typeof="mw:Entity">v</span><span typeof="mw:Entity">a</span><span typeof="mw:Entity">S</span><span typeof="mw:Entity">c</span><span typeof="mw:Entity">r</span><span typeof="mw:Entity">i</span><span typeof="mw:Entity">p</span><span typeof="mw:Entity">t</span></p>
!! end
HTML Hex character encoding bogus encoding (T28437 regression check)
!! wikitext
&#xsee;&#XSEE;
-!! html/php
+!! html
<p>&#xsee;&#XSEE;
</p>
-!! html/parsoid
-<p>&#xsee;&#XSEE;</p>
!! end
!! test
!! html/php
<p>îî
</p>
-!! html/php+tidy
-<p>îî</p>
!! html/parsoid
<p><span typeof="mw:Entity">î</span><span typeof="mw:Entity">î</span></p>
!! end
; Surrogate: ��
; This is an okay astral character: 💩
!! html+tidy
-<dl>
-<dt>Null</dt>
-<dd>&#00;</dd>
-<dt>FF</dt>
-<dd>&#xC;</dd>
-<dt>CR</dt>
-<dd>&#xD;</dd>
-<dt>Control (low)</dt>
-<dd>&#8;</dd>
-<dt>Control (high)</dt>
-<dd>&#x7F; &#x9F;</dd>
-<dt>Surrogate</dt>
-<dd>&#xD83D;&#xDCA9;</dd>
-<dt>This is an okay astral character</dt>
-<dd>💩</dd>
-</dl>
+<dl><dt> Null</dt>
+<dd> &#00;</dd>
+<dt> FF</dt>
+<dd> &#xC;</dd>
+<dt> CR</dt>
+<dd> &#xD;</dd>
+<dt> Control (low)</dt>
+<dd> &#8;</dd>
+<dt> Control (high)</dt>
+<dd> &#x7F; &#x9F;</dd>
+<dt> Surrogate</dt>
+<dd> &#xD83D;&#xDCA9;</dd>
+<dt> This is an okay astral character</dt>
+<dd> 💩</dd></dl>
!! end
!! test
ISBN code coverage
!! wikitext
ISBN 978-0-1234-56 789
-!! html
+!! html/php
<p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a> 789
</p>
-!! html+tidy
-<p><a href="/wiki/Special:BookSources/9780123456" class="internal mw-magiclink-isbn">ISBN 978-0-1234-56</a> 789</p>
!! html/parsoid
<p><a href="./Special:BookSources/9780123456" rel="mw:WikiLink" data-parsoid='{"stx":"magiclink"}'>ISBN 978-0-1234-56</a><span typeof="mw:Entity" data-parsoid='{"src":"&#x20;","srcContent":" "}'> </span>789</p>
!! end
RFC code coverage
!! wikitext
RFC 983 987
-!! html
+!! html/php
<p><a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc983">RFC 983</a> 987
</p>
-!! html+tidy
-<p><a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc983">RFC 983</a> 987</p>
+!! html/parsoid
+<p><a href="https://tools.ietf.org/html/rfc983" rel="mw:ExtLink" class="external text" data-parsoid='{"stx":"magiclink"}'>RFC 983</a><span typeof="mw:Entity" data-parsoid='{"src":"&#x20;","srcContent":" "}'> </span>987</p>
!! end
!! test
<span>a-{H|0=>zh-cn:x<span>y;0=>zh-tw:b<div>c}-d
!! html/php+tidy
-<p><span>ab</span></p>
-<div><span>cd <span>ab</span></span>
-<div><span>cd <span>ad</span></span></div>
-</div>
+<span>ab<div>cd
+<span>ab<div>cd
+<span>ad
+</span></div></span></div></span>
!! html/parsoid
<p><span data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a</span></p><div typeof="mw:LanguageVariant" data-mw-variant='{"disabled":{"t":"b<div data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[10,16,5,0]}'>c</div>"}}'></div><p>d</p>
;<b>foo:bar
;-{zh-cn:AAA
!! html/php+tidy
-<dl>
-<dt><b>foo:bar</b></dt>
-<dt><b>-{zh-cn:AAA</b></dt>
-</dl>
+<dl><dt><b>foo:bar</b></dt><b>
+<dt>-{zh-cn:AAA</dt></b></dl><p><b>
+</b></p>
!! html/parsoid
<dl><dt data-parsoid='{"dsr":[0,11,1,0]}'><b data-parsoid='{"stx":"html","autoInsertedEnd":true}'>foo:bar</b></dt><b data-parsoid='{"stx":"html","autoInsertedEnd":true,"autoInsertedStart":true}'>
<dt data-parsoid='{"dsr":[12,20,1,0]}'>-{zh-cn</dt>
!! end
-# Plain MediaWiki does not remove empty lists, but tidy actually does.
-# Templates in Wikipedia rely on this behavior, as tidy has always been
-# enabled there. These tests are normally run *without* tidy, so specify the
-# full output here.
-# To test realistic parsing behavior, apply a tidy-like transformation to both
-# the expected output and your parser's output.
!! test
-T2529: Uncovered bullet leaving empty list, normally removed by tidy
+T2529: Uncovered bullet in a deeply nested list
!! wikitext
******* Foo {{bullet}}
!! html
!! end
+# doBlockLevels screws up this output and Remex cleans up as much as it can.
+# Parsoid seems to do a better job here since its p-wrapper is probably smarter.
!! test
Nesting tags, paragraphs on lines which begin with <div>
!! wikitext
<div></div><strong>A
B</strong>
!! html/php+tidy
-<p><strong>A</strong></p>
-<p><strong>B</strong></p>
+<div></div><p><strong>A
+</strong></p><strong></strong><p><strong>B</strong>
+</p>
!! html/parsoid
<div></div>
<p><strong>A
Line two</blockquote>
!! html+tidy
-<blockquote>
-<p>Line one Line two</p>
-</blockquote>
+<blockquote><p>Line one
+Line two</p></blockquote>
!! end
!! test
!! html+tidy
<blockquote>
-<p>Line one</p>
-Line two</blockquote>
+<p>Line one
+</p><p>
+Line two</p></blockquote>
!! end
!! test
</blockquote>
!! html+tidy
-<blockquote>
-<p>Line one</p>
-<p>Line two</p>
+<blockquote><p>Line one
+</p><p>Line two
+</p>
</blockquote>
!! end
</p>
</blockquote>
-!! html+tidy
-<blockquote>
-<p>Line one</p>
-<p>Line two</p>
-</blockquote>
!! end
+# FIXME: Why does/should the blockquote+div combo suppress p-wrapping here?
!! test
Paragraphs inside blockquotes/divs (no extra line breaks)
!! wikitext
<h2><span class="mw-headline" id="Quote"><blockquote>Quote</blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! html/php+tidy
-<p></p>
-<div id="toc" class="toc">
-<div class="toctitle" lang="en" dir="ltr" xml:lang="en">
-<h2>Contents</h2>
-</div>
+<div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Quote"><span class="tocnumber">1</span> <span class="toctext">Quote</span></a></li>
</ul>
</div>
-<p></p>
-<h2><span class="mw-headline" id="Quote"></span></h2>
-<blockquote>
-<p><span class="mw-headline" id="Quote">Quote</span></p>
-</blockquote>
-<p><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></p>
+
+<h2><span class="mw-headline" id="Quote"><blockquote><p>Quote</p></blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Main_Page&action=edit&section=1" title="Edit section: Quote">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! html/parsoid
<meta property="mw:PageProp/toc" data-parsoid='{}'/>
<h2 id="Quote" data-parsoid='{}'> <blockquote>Quote</blockquote> </h2>
<h2><span class="mw-headline" id="Foo_Bar_2"><i>Foo</i> <blockquote>Bar</blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! html/php+tidy
-<p></p>
-<div id="toc" class="toc">
-<div class="toctitle" lang="en" dir="ltr" xml:lang="en">
-<h2>Contents</h2>
-</div>
+<div id="toc" class="toc"><div class="toctitle" lang="en" dir="ltr"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Foo_Bar"><span class="tocnumber">1</span> <span class="toctext"><i>Foo</i> <b>Bar</b></span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Foo_Bar_2"><span class="tocnumber">2</span> <span class="toctext"><i>Foo</i> Bar</span></a></li>
</ul>
</div>
-<p></p>
+
<h2><span class="mw-headline" id="Foo_Bar"><i>Foo</i> <b>Bar</b></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-<h2><span class="mw-headline" id="Foo_Bar_2"><i>Foo</i></span></h2>
-<blockquote>
-<p><span class="mw-headline" id="Foo_Bar_2">Bar</span></p>
-</blockquote>
-<p><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></p>
+<h2><span class="mw-headline" id="Foo_Bar_2"><i>Foo</i> <blockquote><p>Bar</p></blockquote></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: Foo Bar">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! html/parsoid
<meta property="mw:PageProp/toc" data-parsoid='{}'/>
<h2 id="Foo_Bar" data-parsoid='{}'> <i data-parsoid='{"stx":"html"}'>Foo</i> <b data-parsoid='{"stx":"html"}'>Bar</b> </h2>
<h2 id="test_test_test" data-parsoid='{}'> <s>test</s> test <strike>test</strike> </h2>
!! end
-# Note that the html output does not have the <p></p>, but the
-# html+tidy output *does*. This is because the empty <p></p> is
-# removed by the sanitizer, but only when tidy is *not* enabled (!).
!! test
Empty <p> tag in TOC, removed by Sanitizer (T92892)
!! wikitext
<h2><span class="mw-headline" id="x">x</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: x">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
-!! html/php+tidy
-<p></p>
-<div id="toc" class="toc">
-<div class="toctitle" lang="en" dir="ltr" xml:lang="en">
-<h2>Contents</h2>
-</div>
-<ul>
-<li class="toclevel-1 tocsection-1"><a href="#x"><span class="tocnumber">1</span> <span class="toctext">x</span></a></li>
-</ul>
-</div>
-<p></p>
-<h2><span class="mw-headline" id="x">x</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: x">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
!! html/parsoid
<meta property="mw:PageProp/toc" data-parsoid='{}'/>
<h2 id="x" data-parsoid='{}'> x </h2>
|}
!! html/php+tidy
<table>
+<tbody><tr>
+<td>foo|bar
+</td></tr>
<tr>
-<td>foo|bar</td>
-</tr>
-<tr>
-<td>x
-<div>a|b</div>
-</td>
-</tr>
-</table>
+<td>x<div>a|b</div>
+</td></tr></tbody></table>
!! end
!! test
!! wikitext
<div title="Hello world />Foo
!! html/php+tidy
-<div title="Hello world"></div>
-<p>Foo</p>
+<div title="Hello world"></div><p>Foo
+</p>
!! html/parsoid
<div title="Hello world " data-parsoid='{"stx":"html","selfClose":true}'></div><p>Foo</p>
!! end
</tbody></table>
!!end
-# Parsoid-only since PHP parser relies on Tidy for correct output
+# Parsoid-only test of a DOM pass
!!test
Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out
-!!options
-parsoid
!! wikitext
{|
|<small>foo
{|
|<small>foo<small>
|}
-!! html
+!! html/parsoid
<table>
<tbody><tr data-parsoid='{"autoInsertedEnd":true,"autoInsertedStart":true}'><td data-parsoid='{"autoInsertedEnd":true}'><small data-parsoid='{"stx":"html","autoInsertedEnd":true}'>foo
<p>bar</p></small></td></tr>
[http://foo.com PMID 1234]
[http://foo.com ISBN 123456789x]
!! html+tidy
-<p><a href="/wiki/Foo" title="Foo">http://example.com</a> <a href="/wiki/Foo" title="Foo">RFC 1234</a> <a href="/wiki/Foo" title="Foo">PMID 1234</a> <a href="/wiki/Foo" title="Foo">ISBN 123456789x</a></p>
-<p><a rel="nofollow" class="external text" href="http://foo.com">http://example.com</a> <a rel="nofollow" class="external text" href="http://foo.com">RFC 1234</a> <a rel="nofollow" class="external text" href="http://foo.com">PMID 1234</a> <a rel="nofollow" class="external text" href="http://foo.com">ISBN 123456789x</a></p>
+<p><a href="/wiki/Foo" title="Foo">http://example.com</a>
+<a href="/wiki/Foo" title="Foo">RFC 1234</a>
+<a href="/wiki/Foo" title="Foo">PMID 1234</a>
+<a href="/wiki/Foo" title="Foo">ISBN 123456789x</a>
+</p><p><a rel="nofollow" class="external text" href="http://foo.com">http://example.com</a>
+<a rel="nofollow" class="external text" href="http://foo.com">RFC 1234</a>
+<a rel="nofollow" class="external text" href="http://foo.com">PMID 1234</a>
+<a rel="nofollow" class="external text" href="http://foo.com">ISBN 123456789x</a>
+</p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Foo" title="Foo">http://example.com</a>
<a rel="mw:WikiLink" href="./Foo" title="Foo">RFC 1234</a>
[[File:Foobar.jpg|thumb|PMID 1234]]
[[File:Foobar.jpg|thumb|ISBN 123456789x]]
!! html+tidy
-<div class="thumb tright">
-<div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>
-<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div>
-</div>
-</div>
-<div class="thumb tright">
-<div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>
-<a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc1234">RFC 1234</a></div>
-</div>
-</div>
-<div class="thumb tright">
-<div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>
-<a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a></div>
-</div>
-</div>
-<div class="thumb tright">
-<div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>
-<a href="/wiki/Special:BookSources/123456789X" class="internal mw-magiclink-isbn">ISBN 123456789x</a></div>
-</div>
-</div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc1234">RFC 1234</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a class="external mw-magiclink-pmid" rel="nofollow" href="//www.ncbi.nlm.nih.gov/pubmed/1234?dopt=Abstract">PMID 1234</a></div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div><a href="/wiki/Special:BookSources/123456789X" class="internal mw-magiclink-isbn">ISBN 123456789x</a></div></div></div>
!! html/parsoid
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption><a rel="mw:ExtLink" href="http://example.com">http://example.com</a></figcaption></figure>
<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption><a href="https://tools.ietf.org/html/rfc1234" rel="mw:ExtLink">RFC 1234</a></figcaption></figure>
|}
!! html/php+tidy
<table>
+<tbody><tr>
+<th>-
+</th>
+<th>-
+</th></tr>
<tr>
-<th>-</th>
-<th>-</th>
-</tr>
-<tr>
-<td>-</td>
-<td>-</td>
-</tr>
+<td>-
+</td>
+<td>-
+</td></tr>
<tr>
-<td><small>-</small></td>
-<td><br />
-<p>-</p>
+<td><small>-</small>
</td>
<td><br />
-<p>-</p>
+<p>-
+</p>
</td>
-</tr>
-</table>
+<td><br />
+<p>-
+</p>
+</td></tr></tbody></table>
!! end
!! test
*
*
* b
-!! html/php+tidy
-<ul>
-<li>a</li>
-<li class="mw-empty-elt"></li>
+!! html+tidy
+<ul><li> a</li>
+<li class="mw-empty-elt"> </li>
<li class="mw-empty-elt"></li>
-<li>b</li>
-</ul>
+<li> b</li></ul>
!! end
+# FIXME: Why is there no html/parsoid section here?
!! test
Thumbnail output
!! wikitext
[[File:Thumb.png|thumb]]
!! html/php+tidy
-<div class="thumb tright">
-<div class="thumbinner" style="width:137px;"><a href="/wiki/File:Thumb.png" class="image"><img alt="Thumb.png" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a>
-<div class="thumbcaption">
-<div class="magnify"><a href="/wiki/File:Thumb.png" class="internal" title="Enlarge"></a></div>
-</div>
-</div>
-</div>
+<div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/File:Thumb.png" class="image"><img alt="Thumb.png" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a> <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Thumb.png" class="internal" title="Enlarge"></a></div></div></div></div>
!! end
!! test