Page MenuHomePhabricator

Parsoid: selser drops last three apostrophes in '''''foo'''''
Closed, ResolvedPublic


See - an attempt to enter a dash led to bolding vanishing. Not sure what's going on there.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:55 AM
bzimport set Reference to bz50068.

Roan, can you tell how we're dirtying the DOM such that Parsoid changes these at all?

We've seen this come up a number of times in our testing; I haven't investigated this one yet.

This turns out to be a Parsoid bug:

$ echo "Foo '''''bar''''' baz" > wt
$ node parse.js --wt2html < wt | tee html
<body><p data-parsoid='{"dsr":[0,21,0,0]}'>Foo <i data-parsoid='{"dsr":[4,14,2,2]}'><b data-parsoid='{"autoInsertedEnd":true,"dsr":[6,12,3,0]}'>bar</b></i> baz</p>
$ sed 's/baz/baaz/g' < html | tee html2
<body><p data-parsoid='{"dsr":[0,21,0,0]}'>Foo <i data-parsoid='{"dsr":[4,14,2,2]}'><b data-parsoid='{"autoInsertedEnd":true,"dsr":[6,12,3,0]}'>bar</b></i> baaz</p>
$ node parse.js --html2wt --selser --oldtextfile wt --oldhtmlfile html < html2
Foo '''''bar'' baaz

Note that this doesn't break if there is no DOM change (i.e. if you pipe in html rather than html2 in the last step), and it also doesn't break if selser is disabled (i.e. if you omit --selser in the last step).

Here are actually two bugs:

  1. a VE bug that causes that paragraph to be dirtied
  2. a Parsoid bug that does not round-trip the bolding properly when using selser on bold elements

Should I open a separate bug for VisualEditor, or do you have one for this already?

I can't reproduce the dirtying of the paragraph locally. If I make a null change, I get a null diff. If I change anything outside the bold+italic text, I get the bad diff.

There are some dirtying issues with the code that was in production at the time, and still one left for which the fix is not deployed. That said, the minimal test case for this ( ) does have a neighboring change.

  • Bug 50258 has been marked as a duplicate of this bug. ***

Related URL: (Gerrit Change I69bda7db141a3302cee6ece5af5ffdc57e748d89)

Related URL: (Gerrit Change I69bda7db141a3302cee6ece5af5ffdc57e748d89) (Gerrit Change I69bda7db141a3302cee6ece5af5ffdc57e748d89) | change APPROVED and MERGED [by jenkins-bot]