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 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.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 26 2016, 4:41 PM
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 added a project: Parsoid.
Jdforrester-WMF triaged this task as High priority.
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.

ssastry added a subscriber: ssastry.Nov 8 2016, 8:54 PM

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
|}
Jdforrester-WMF set the point value for this task to 0.

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 moved this task from Backlog to In Progress on the Parsoid board.Dec 1 2016, 4:52 PM
ssastry claimed this task.
ssastry closed this task as Resolved.

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