VisualEditor: <span> annotations next to each other aren't necessarily the same
Closed, ResolvedPublic

Description

Two users have reported on this.

See:
http://en.wikipedia.org/w/index.php?title=User:AussieLegend/Vandals_etc&diff=prev&oldid=560719781

And:
http://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#Font_colors_in_signatures_changed

I realize that this is probably tied into other behavior, but I lack code-fu to determine what. :)

Maggie


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=42803

In this case:

<span style="color:green;">Aussie</span><span style="color:gold;">Legend</span>

… is being simplified by DM into:

<span style="color:green;">AussieLegend</span>

… which, unsurprisingly, Parsoid assumes means we wanted to combine them. :-)

This is the same as bug 49478. We are dependent on it being in Parsoid first, otherwise we would reintroduce bug 48110.

  • This bug has been marked as a duplicate of bug 42803 ***
  • This bug has been marked as a duplicate of bug 48194 ***
GWicke added a comment.Jul 2 2013, 3:17 AM

Several of these issues are actually on the VE side, so reopening.

I still see annotation merging on this test case:

http://www.mediawiki.org/wiki/User:GWicke/TestDoubleFormatting?veaction=edit

Steps to reproduce:

  • append a char to 'baz'
  • preview the change

Result: The bold ranges are merged, leading to a dirty diff
Expected result: no merging and no dirty diff

(In reply to comment #6)

I still see annotation merging on this test case:

http://www.mediawiki.org/wiki/User:GWicke/TestDoubleFormatting?veaction=edit

Steps to reproduce:

  • append a char to 'baz'
  • preview the change

    Result: The bold ranges are merged, leading to a dirty diff Expected result: no merging and no dirty diff

That should be the only remaining annotation merging issue. I've been meaning to file a bug about it but I keep forgetting.

Ed, we need to preserve the difference between <b>Foo</b><b>Bar</b> and <b>FooBar</b> somehow. Feel free to hit me up on IRC if you want to talk about how we should do that.

All we need to do is turn off similar annotation comparisons in VE completely, but Parsoid is not ready for that yet, for example adding new bold text next to Parsoid-generated bold text would create:

<b data=parsoid="">Old bold text</b><b>New bold text from VE</b>

which Parsoid should obviously merge to:

'''Old bold textNew bold text from VE'''

but doesn't yet.

Once this is all handled correctly, we can turn off similar annotation comparisons and the two bolds in <b>Foo</b><b>Bar</b> will no longer be merged (as they have will have different data-parsoid's). Of course Parsoid will not want to merge them either so that will factor into their logic.

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

Adding Parsoid bug 42803 as a dependency. We do add nowiki between most cases of adjacent quotes to ensure at least correctness, but the markup will indeed not be optimal.

Change 73523 had a related patch set uploaded by Esanders:
HACK: Don't merge adjacent annotations from Parsoid

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

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

Change 73523 merged by jenkins-bot:
HACK: Don't merge adjacent annotations from Parsoid

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

Merged and will go out tomorrow.

Add Comment