Page MenuHomePhabricator

Parsoid serialised an edit to a wikitext table adding a /n without stripping the double-pipes, breaking the table format (`\n|| align="right" | …`)
Closed, ResolvedPublic0 Estimated Story Points

Description

Please see the history of this page. You can discover that the lines are all broken, can we put <br/> instead of 1 empty line in VE for to break a line forcefully.

Event Timeline

Jdforrester-WMF renamed this task from Visual Editor messing with table when I want to create a break line and save to Parsoid serialised an edit to a wikitext table adding a /n without stripping the double-pipes, breaking the table format (`\n|| align="right" | …`).Nov 8 2016, 8:31 PM
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF added a project: Parsoid.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Possibly we're doing something odd in VE too, but this serialisation is always going to be wrong.

The base serialization code definitely needs a fix to deal with embedded newlines.

[subbu@earth parsoid] cat /tmp/html
<table>
<tbody>
<tr><td>a
b
</td><td data-parsoid='{"stx_v":"row"}' align='right'>c</td></tr>
</tbody>
</table>

[subbu@earth parsoid] parse.js --html2wt < /tmp/html
{|
|a
b
|| align="right" |c
|}

Another example to demonstrate bad serialization (from T149428#2790836)

[subbu@earth ~] cat /tmp/boo
[subbu@earth ~] cat /tmp/boo
<table><tbody>
<td><p>foo</p></td><td data-parsoid='{"stx_v":"row"}'>boo</td>
</tbody></table>
[subbu@earth ~] parse.js --html2wt < /tmp/boo
{|
|foo
||boo
|}

Change 322955 had a related patch set uploaded (by Subramanya Sastry):
WIP: T149209: Deal with newlines in <td> cells

https://gerrit.wikimedia.org/r/322955

Change 322955 merged by jenkins-bot:
T149209: Deal with newlines in <td> and <th> cells

https://gerrit.wikimedia.org/r/322955

ssastry claimed this task.
ssastry moved this task from Needs Triage to In Progress on the Parsoid board.

This code has been merged and rt-tested. This will be live on the next deploy (probably next week).