Page MenuHomePhabricator

Parsoid serialises empty table cells with td parameters incorrectly
Open, MediumPublic0 Estimated Story Points

Description

Hello. You can't edit tables in VE properly for cells with td parameters (multi-span, style, and so on).
For example:

  1. Open this table.
  2. Copy the code to your draft and save it.
  3. Open it in VE.
  4. Pick KG cell.
  5. Press the delete button on your keyboard.
  6. It looks fine.
  7. Save it.
  8. It looks not fine.

Thank you.

Event Timeline

IKhitron triaged this task as Medium priority.Aug 9 2016, 12:17 PM
Amire80 renamed this task from VE table editor can't recognize multispan empty sells to VisualEditor table editor can't recognize multispan empty cells.Aug 9 2016, 12:42 PM
Amire80 updated the task description. (Show Details)
Amire80 awarded a token.

If "it looks fine on edit but saves badly" then it's almost certainly a bug in Parsoid.

Jdforrester-WMF renamed this task from VisualEditor table editor can't recognize multispan empty cells to Parsoid serialises multi-span empty table cells incorrectly.Aug 9 2016, 7:27 PM
Jdforrester-WMF set the point value for this task to 0.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
IKhitron renamed this task from Parsoid serialises multi-span empty table cells incorrectly to Parsoid serialises empty table cells with td parameters incorrectly.Aug 10 2016, 5:45 PM
IKhitron updated the task description. (Show Details)

Well, it's more than just multi-span. Any || ... | ... fails.

Yes, the problem is that reusing the same | chars in ambiguous ways in wikitext makes this a problem.

{|
|-
|a||class='c'|x||y
|-
|a||class='c'|||y
|-
|a||class='c'| ||y
|}

So, the middle row parses the "|||y" as a table cell without an attribute .. but "| ||y" parses as 2 table cells.

Anyway, the wikitext serialization code needs to aware of this oddity when it gets an empty cell and insert a dummy white-space char or a dummy comment.