Page MenuHomePhabricator

Update VisualEditor to be compatible with magic links being disabled
Open, LowPublic1 Estimated 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

AlexMonk-WMF subscribed.

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 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?

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 :)

I think ideally we'd generate the appropriate templates in VE, which has access to system messages and whatnot, and not try to do magic autoconversion in Parsoid. On wikis w/o magic links configured, Parsoid will never give VE any links with stx="magiclink" and hopefully VE will never generate them in edited HTML either.

@matmarex points out that if we're pulling the template names from wikidata, as @Legoktm suggested, than Parsoid could probably do it just as well as VE. Parsoid doesn't have easy access to system messages, so if you use the system message <something>-isbn-template to localize the template then VE is the easiest place to do that.

Aklapper added a subscriber: cscott.

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)