Suppose I have a wiki article that contains only this text:
I want to perform an edit in VisualEditor to change the link text, so I end up with this underlying wikitext:
I tried this in VisualEditor 0.1.0 (MediaWiki 1.26.2), and the results are intermittent:
- Click the link so the Edit button appears.
- Highlight the entire link text by click-and-drag (NOT by double-clicking or typing ctrl-A)
- Type "Wikipedia". Notice that the word appears in the blue highlighting, indicating that it's still a link.
- Click away. The hyperlink is deleted and just the text, "Wikipedia", remains.
The correct replacement happens if you double-click the link text, or press ctrl-A to select the link text, but not if you click and drag. This really confused me for about 15 minutes...
The problem seems intermittent. It seems to work better when I click on the far right side of the link text (between the rightmost character and the little "external link" icon) and drag to the far left. I get more problems when I click on the leftmost character of the link and drag to the far right.
Suggestion: display an "Add Label" button like you do for links of this form:
whenever the link text equals the URL?