Page MenuHomePhabricator

VisualEditor: Support creation of auto-numbered external links and to convert them to labeled ones
Closed, ResolvedPublic

Description

The way VisualEditor handles links with square brackets, but no explicit anchor, can be confusing. These links are generally discouraged on English Wikipedia, but still occasionally used.

An example is https://en.wikipedia.org/w/index.php?title=User:Superm401/Sandbox&veaction=edit&oldid=564175896 . The wikitext for this is just [http://example.com], which renders as a linked [1] (or whatever number it is in the page)

However, you should edit the latest version of a page for testing this. When you edit an oldid page, you won't be able to reproduce the "Save page" disable behavior I mention below.

VisualEditor lets you backspace to remove the characters one by one, which does not really reflect the model of how the link works. After one or more is removed, "Save page" un-greys. However, when you go to review the changes, it says, "Could not start the review because your revision matches the latest version of this page."

It does let you remove the link entirely, but to do so you need to explicitly remove each character (not just backspace once to delete the whole thing).

Do a fresh load of the edit page (separate test). Then, click the chain icon next to the link. Then, press enter twice to exit the link dialog. This time, review changes works. The wikitext becomes:

[http://example.com <nowiki>[1]</nowiki>]

It probably should not change the link if you simply enter the link dialog and press enter without changing anything. Also, forcing it to text like this is inconsistent with what happens if you delete the right bracket (see above).


Version: unspecified
Severity: enhancement

Details

Reference
bz51309

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:53 AM
bzimport set Reference to bz51309.

Also, if you highlight it, then use "Clear formatting", it does nothing. I'm not sure what it should do (nowiki the URL?), but if it does nothing it should be greyed out.

Current status:

You can …

  • … edit the target of an auto-numbered external link to a different external link; and
  • … edit the target of an auto-numbered external link to an internal link, and the anchor will automatically be set as the internal link value.

You cannot …

  • … create an auto-numbered external link;
  • … convert an auto-numbered external link to a real external link; or
  • … "clear formatting" on an auto-numbered external link.

I think the first two are valuable, but the third isn't, because we're planning to remove the function of removing links and other rich styling from the "clear formatting" function button. Re-titling, setting priority.

(In reply to Matthew Flaschen from comment #0)

VisualEditor lets you backspace to remove the characters one by one, which
does not really reflect the model of how the link works.

This is fixed. It now highlights on first backspace, and erases on second, which I think is handled the same as similar things.

(In reply to Matthew Flaschen from comment #3)

(In reply to Matthew Flaschen from comment #0)

VisualEditor lets you backspace to remove the characters one by one, which
does not really reflect the model of how the link works.

This is fixed. It now highlights on first backspace, and erases on second,
which I think is handled the same as similar things.

Yeah, sorry, forgot to say "we've done a bunch of work on auto-numbered external links since this bug was filed, so most of this is fixed, however…" at the top. :-)

Change 143346 had a related patch set uploaded by Bartosz Dziewoński:
Make it possible to create autonumbered external links from link inspector

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

(In reply to James Forrester from comment #2)

You cannot …

  • … create an auto-numbered external link;

My patch https://gerrit.wikimedia.org/r/143346 implements this.

  • … convert an auto-numbered external link to a real external link; or

You can do that from ve.ui.MWLinkNodeInspector now, I don't know when it was implemented.

  • … "clear formatting" on an auto-numbered external link.

I think the first two are valuable, but the third isn't, because we're
planning to remove the function of removing links and other rich styling
from the "clear formatting" function button.

I don't think treating it as "formatting" makes sense anyway.

(In reply to Bartosz Dziewoński from comment #6)

(In reply to James Forrester from comment #2)

You cannot …

[…]

  • … convert an auto-numbered external link to a real external link; or

You can do that from ve.ui.MWLinkNodeInspector now, I don't know when it was
implemented.

Yes, that was fixed a month or so ago with the creation of MWLinkNodeInspector.

Change 143346 merged by jenkins-bot:
Make it possible to create autonumbered external links from link inspector

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

Is it possible to convert an auto-numbered link to one with arbitrary text (that's what the second part of the bug title refers to)?

(In reply to Matthew Flaschen from comment #9)

Is it possible to convert an auto-numbered link to one with arbitrary text
(that's what the second part of the bug title refers to)?

Yes, that's been possible for a while. In https://meta.wikimedia.org/wiki/Tech/News/2014/27?veaction=edit for example, click on one of the auto-numbered links to edit it, then click "add label" to convert it to a "normal" link.