Page MenuHomePhabricator

Content in list item not serialized correctly
Open, LowPublic

Description

$ echo '<ul><li><table><tr><td>foo</td></tr></table>' | php bin/parse.php --html2wt | php bin/parse.php --wt2html --normalize

<ul>
<li>{| |foo |}</li>
</ul>

The problem here is the first step:

$ echo '<ul><li><table><tr><td>foo</td></tr></table>' | php bin/parse.php --html2wt
*  {| |foo |}

Parsoid seems to realize that this content can't have newlines inserted; see:

$ echo '<ul><li><table><tr><td>foo</td></tr><tr><td>bar</td></tr></table>' | php bin/parse.php --html2wt
*  {| |foo |- |bar |}

...but it doesn't realize that the newlines are necessary in order to make this valid table content.

Parsoid *should* convert from * representation for the list item to explicit HTML tag representation (<li>), but this means changing the representation for all items in the list.

Depending on the outcome of T230683, we could use heredoc syntax for the content instead of suppressing newlines.

Event Timeline

LGoto triaged this task as Low priority.Mar 27 2020, 4:16 PM
LGoto moved this task from Backlog to Feature requests on the Parsoid board.

Making T230683 a subtask at the moment, since we're probably not going to fix this until the cure is less disruptive. (Right now you'd recursively need to convert the list and all parent lists to explicit HTML syntax.)

Parsoid *should* convert from * representation for the list item to explicit HTML tag representation (<li>), but this means changing the representation for all items in the list.

Or it could represent the table with HTML syntax instead of wikitext syntax, couldn't it?