Page MenuHomePhabricator

Meta nodes are moved outside of table cells / list items when they appear as their last children, which breaks editing of those tables/lists
Open, Needs TriagePublic

Description

Meta nodes are moved outside of table cells / list items when they appear as their last children, which breaks editing of those tables/lists (in the same manner as T189543).

Example inputs:

<ul>
<li>foo<meta /></li>
</ul>
<table>
<tr>
<td>foo<meta /></td>
</tr>
</table>

Event Timeline

https://gerrit.wikimedia.org/r/#/c/419145/ adds some test cases for this, I'm not planning to work on it further right now.

matmarex added subscribers: bd808, dduvall, Agusbou2015.

Real-world example from T387414: Insert above/below throwing error instead of adding a new row:

The Parsoid HTML has the <link> tag at the end of a <td>…</td> tag: https://www.mediawiki.org/w/rest.php/v1/revision/7059754/html

image.png (1×1 px, 247 KB)

In VE debug mode, you can see that the corresponding node is outside of the corresponding table cell: https://www.mediawiki.org/w/index.php?oldid=7059754&veaction=edit&debug=true

image.png (1×1 px, 180 KB)

As a result, VE tries to treat that category node as if it was a table cell, and things go wrong. This exception is thrown when it tries to copy its style to the new row (whether it is a content or header cell), but if it wasn't that, something else would probably break.