Page MenuHomePhabricator

Stray closing tr on line with other closing tags
Closed, DeclinedPublic

Description

From https://prv-tests.wmcloud.org/diff/viwiki/Doraemon

Snippit,

<table><tr><td>x</td></tr></table></tr>
foo

bar

Note that both parsers will have the same output if the stray </tr> is on its own line, Parsoid's output is a bit more consistent

$closeMatch is pretty naive
https://github.com/wikimedia/mediawiki/blob/master/includes/Parser/BlockLevelPass.php#L325-L334

Event Timeline

$ (master) cat t
<table></table></tr>
foo


bar

$ (master) cat t | php maintenance/run parse
<table></table>
<p>foo
</p><p><br />
bar
</p><p><br />
</p>

$ (master) cat t | php maintenance/run parse --parsoid
<section data-mw-section-id="0" id="mwAQ"><table id="mwAg"></table><p id="mwAw">
foo


bar</p>

</section>

$ (master) cat t
</tr>
foo


bar

$ (master) cat t | php maintenance/run parse          
<p>
foo


bar

</p>

$ (master) cat t | php maintenance/run parse --parsoid
<section data-mw-section-id="0" id="mwAQ"><p id="mwAg">
foo


bar</p>

</section>