Page MenuHomePhabricator

VisualEditor: Editing a link spanning a comment splits the link
Closed, ResolvedPublic

Description

Tested on Firefox 22 (Monobook) and Chrome 28 (Vector)

Steps to reproduce:

  • Edit the [[Nodeulseom]] page in the visual editor.
  • Click reference [1] and edit it.
  • Click the hyperlink in the reference and point it to "http://www.koreatimes.co.kr/" (Eg: Just remove the last part from the reference)
  • Apply the change.
  • Hit "Save Page" and review the changes.

Instead of replacing the old link, it seems that the preview suggest that the link will be duplicated, leaving both the old and new link in the reference.

(Diff)
<ref>[http://www.koreatimes.co.kr/ (The Korea Times)][http://www.koreatimes.co.kr/www/news/nation/nation_view.asp?newsIdx=5635&categoryCode=115 <!-- Bot generated title -->]</ref>


Version: unspecified
Severity: major

Details

Reference
bz52127

Event Timeline

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

This is a more general problem. We never unannotate comments or any other metadata. For instance:

  • If you have [[Foo|Bar<!--Baz-->Quux]] and change the link target, you'll split the link: [[Foo2|Bar]][[Foo|<!--Baz-->]][[Foo2|Quux]] (that's also what happened here)
  • If you have Foo<!--Bar-->Baz, it renders as "FooBar". If you then make that italic, you'll get ''Foo''<!--Bar-->''Baz''

The root of the problem is that ve.dm.TransactionProcessor#applyAnnotations doesn't annotate/unannotate metadata. Tomorrow I'll see if I can write a failing test case and fix applyAnnotations()

Change 141063 had a related patch set uploaded by Catrope:
Also annotate metadata in TransactionProcessor

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

Change 141063 merged by jenkins-bot:
Also annotate metadata in TransactionProcessor

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

(In reply to Gerrit Notification Bot from comment #3)

Change 141063 merged by jenkins-bot:
Also annotate metadata in TransactionProcessor

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

Helpfully, this doesn't actually fix the bug (just a number of related bugs where the comment isn't on the edge of the link). Assigned.

This is now fixed because comments are editable (finally), but there's a wider, lower-priority issue for non-comments, for which I have created bug 68779 to track.