Page MenuHomePhabricator

VisualEditor: Adjacent link annotations (one of which is from Parsoid, one from VisualEditor) should conjoin
Closed, ResolvedPublic


Steps to reproduce:

  1. Insert the cursor immediately after the first letter of a link
  2. Hit delete/backspace
  3. Type a new character
  4. The new character isn't part of the link, so select the entire word and click the link button
  5. Re-enter the link article
  6. Save your changes

Expected result:
If you started with "[[Porcupine]]", you should end up with "[[porcupine]]".

Actual result:
If you started with "[[Porcupine]]", you end up with "[[porcupine|p]][[Porcupine|orcupine]]".

This is just a common use case demonstrating a more general bug. Namely, if you create a new link that subsumes an existing link, the existing link is preserved within the new link instead of being replaced.

Version: unspecified
Severity: normal
See Also:



Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 1:50 AM
bzimport set Reference to bz49985.

Ed, is this due to the DM stuff around adjacent annotations?

Similar but different. This case should definitely be fixed in VE, not Parsoid.

There are two issues here.

First off, we should change getComparableObject() for MWInternalLinkAnnotation to normalize the title and possibly tweak other things to the point where links to the same title are comparable, even if they have different capitalizations or space-vs-underscore variants of that title. That will be both more semantically correct and serve as a workaround for this bug.

Secondly, because we want to stop merging comparable but different annotations in the converter, we need Parsoid to correctly process at least things like <a href="Porcupine">p</a><a href="Porcupine">orcupine</a> (adjacent <a>s with the same href) and possibly <a href="porcupine">p</a><a href="Porcupine">orcupine</a> as well (adjacent <a>s with different hrefs that normalize to the same title).

Related URL: (Gerrit Change I5fb5bfc69c344ca4ce4803d7b6116074648a8d7e)

Change 70633 merged by jenkins-bot:
Fix comparison of MW internal links

(In reply to comment #5)

Change 70633 merged by jenkins-bot:
Fix comparison of MW internal links

And with that change, this bug is fixed; closing. It will be deployed this afternoon.