Page MenuHomePhabricator

Entering a single '-' character in a table results in a new row
Closed, ResolvedPublic0 Estimated Story Points


Entering the character - in a table cell results in the sequence |- which makes a new row, visible after saving (dirty round trip)

Event Timeline

Martijn_Hoekstra raised the priority of this task from to Needs Triage.
Martijn_Hoekstra updated the task description. (Show Details)
Martijn_Hoekstra added a subscriber: Martijn_Hoekstra.
Restricted Application added a project: VisualEditor. · View Herald TranscriptFeb 2 2015, 8:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
matmarex added a subscriber: matmarex.

Can you provide an example where this happens? A test page or a diff? shows that Parsoid does the right thing.

my edit went from empty to - maybe that makes a difference?

ssastry triaged this task as Medium priority.Feb 4 2015, 12:16 AM
ssastry set Security to None.

Thank you. We should be able to reproduce this with a test case and fix this now.

ssastry moved this task from Needs Triage to VE Q3 on the Parsoid board.Feb 4 2015, 12:17 AM
cscott added a subscriber: cscott.Feb 19 2015, 7:35 PM

See T88148, for an instance of the opposite problem.

We should really emit | - (note the space) when <td> contents start with a dash.

ssastry assigned this task to cscott.Mar 3 2015, 6:37 PM
cscott added a comment.Mar 4 2015, 9:57 PM

Reproduced the bug with
But it only applies to the first instance of - in the table cell, which is weird.

Ah ha!

$ echo '<table><tr><td>-</td><td>- </td><td>-<p></p></td><td><p>-</p></td><tr><p>- </p></td></tr></table>' | tests/parse.js --html2wt
|<nowiki>- </nowiki>

If you type "-" followed by space you get <p>- </p> -- I think you can get the <p>-</p> (no space) by typing a trailing space and then deleting it.

In any case, the <p>-wrapped - is what's causing the bug here.

Change 194541 had a related patch set uploaded (by Cscott):
WIP: T88318: Fix serialization of <p>-wrapped dash within <td>.

Change 194541 merged by jenkins-bot:
T88318: Fix serialization of <p>-wrapped dash within <td>.

Will this go out tomorrow? Fab. :-)

Yes, once @cscott fixes the regression i found for him :)

Looks like there was a regression:

| [[2015年オーストラリアグランプリ|AUS]]<br /><small>-</small>

went to

| [[2015年オーストラリアグランプリ|AUS]]<br /><small><nowiki>-</nowiki></small>

Looks like the "first child" test isn't strong enough/working.

[subbu@earth tests] echo "<table><td><small>-</small></td></table>" | node parse --html2wt

From subbu:

subbu: same with
subbu: you need to tweak the nowiki fix .. 
subbu: [subbu@earth tests] echo "<table><td><small>-</small></td></table>" | node parse --html2wt
subbu: {|
subbu: |<small><nowiki>-</nowiki></small>
subbu: |}

Change 195816 had a related patch set uploaded (by Cscott):
T88318: Fix regression in <nowiki> behavior with nested - in <td>.

Change 195816 merged by jenkins-bot:
T88318: Fix regression in <nowiki> behavior with nested - in <td>.

Jdforrester-WMF closed this task as Resolved.Mar 11 2015, 6:57 PM