Page MenuHomePhabricator

Content pasted just after a link is always placed inside a link
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
Text/template is placed inside the wikilink - before the closing ]]

What should have happened instead?:
Text/template should be placed after the ]].

Update:
Not only wikilinks are affected: if you paste something after text in bold, it will be also in bold. Probably affects everything else that has hidden closing markers.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Firefiox 94.0.2

Event Timeline

ppelberg added subscribers: dchan, ppelberg.

@dchan I'm boldly assigning this issue to you. If you think there is someone better suited to work on this, please unassign yourself from this task.

Confirmed that this happens even with the cursor outside the link cartouche. It happens because the paste is calculated entirely within the DM, and the DM cursor positions do not specify on which side of the annotation boundary they lie.

There might not be an easy fix for this, as David points on the model is unaware of the extra cursor positions around a link. The bug here is probably low priority as the error is immediately visible to the user, so they can take steps to fix it.

Esanders renamed this task from Visual Editor - text/template pasted just after the wikilink inserts text/templ. inside wikilink to Content pasted just after a link is always placed inside a link.Dec 15 2021, 6:19 PM
Esanders updated the task description. (Show Details)

Change 747630 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] Use annotations from view when pasting

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

Not always it's clearly visible - if you paste template behind a wikilink, you can select only the template. Or so you think, until you copy it and paste somewhere else. You can easily miss that you just inserted wikilinked template.

Another artifact:
If you style the text that is at the end of a line, as a code, then you can't place the cursor outside of the code block (at the end; you need to "unstyle" the text that you typed after the code block).

Just a remainder that it's still not fixed (pasting templates after wikilinks).
Or if it was fixed, that it's broken again.

Change 747630 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Use annotations from view when pasting

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

This also fixes another thing that has been bugging me for years: inserting code markup using the keyboard shortcut (Ctrl+Shift+6) and then pasting text using the keyboard shortcut (Ctrl+V) now results in the pasted text being marked as code.

Change 976227 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (1947f053c)

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

Change 976227 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (1947f053c)

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