Page MenuHomePhabricator

Update VisualEditor to be compatible with magic links being disabled
Open, LowPublic1 Story Points

Description

VisualEditor needs to be updated to handle magic links being disabled (T47942: "Magic links" RFC, PMID and ISBN should be configurable and disableable).

Event Timeline

Legoktm created this task.Sep 13 2016, 10:41 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 13 2016, 10:41 PM
AlexMonk-WMF added a subscriber: AlexMonk-WMF.

Wouldn't this need to be dealt with in parsoid? Or are you suggesting we might want to disable any kind of recognition of this type of thing in VE?

It'd need to be dealt with in Parsoid too, but VE has client-side auto-magic-linking of typed and pasted content, IIRC?

VE has client-side auto-magic-linking of typed and pasted content, IIRC?

Right. That's the thing - maybe we might want VE generating proper links from that?

Yeah, I think we have two options:

  1. not treat them any different when functionality is disabled, and let users manually create links
  2. When a user types in RFC/ISBN/PMID offer to create a link (like some of the other key sequences) but save it as the wikitext representation (template or interwiki link)
Jdforrester-WMF triaged this task as Low priority.Sep 20 2016, 7:02 PM
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.
  1. When a user types in RFC/ISBN/PMID offer to create a link (like some of the other key sequences) but save it as the wikitext representation (template or interwiki link)

I think this is the best option. If a user types in "RFC 1234", VE should auto-convert it into "[[rfc:1234|RFC 1234]]", same for ISBN and PMID (just different targets).

Typing or pasting an ISBN already automatically converts it to a link in the editor surface, same with RFC and PMID. I suspect the required changes will be minimal (perhaps only Parsoid needs any changes).

Okay, I would appreciate some assistance here as I'm not fully sure how VE and parsoid are interacting in this case...

My hunch that this needed to be done in VE was based on the existence of the "Convert to simple link" button when editing a magic link (e.g. https://www.mediawiki.org/w/index.php?title=Help:Magic_links&veaction=edit) that generates a wikitext link instead of a magic one. Is my hunch incorrect or misguided?

Legoktm assigned this task to cscott.May 23 2017, 5:05 PM

Seems like the projects are deciding to replace magic links with templates. So the VE autocomplete code would need to generate an appropriate template (project-specific, sigh).
@Legoktm says on IRC:

legoktm: 13:06:03> it could use a system message like visualeditor-isbn-template or something.
legoktm: 13:06:32> bonus points if you figure out how to pull the list from https://www.wikidata.org/wiki/Q5617482 :)