|Open||cscott||T145589 Update VisualEditor to be compatible with magic links being disabled|
|Resolved||Legoktm||T47942 "Magic links" RFC, PMID and ISBN should be configurable and disableable|
Yeah, I think we have two options:
- not treat them any different when functionality is disabled, and let users manually create links
- 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)
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?
The "convert to simple link" button is provided by https://phabricator.wikimedia.org/diffusion/EVED/browse/master/modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js;5ac488ba532d64929da93d90c233ec6142dffaa4$34 which calls (indirectly) https://phabricator.wikimedia.org/diffusion/EVED/browse/master/modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js;5ac488ba532d64929da93d90c233ec6142dffaa4$280 but that just creates nodes. If you want them serialised differently I think that can happen in Parsoid without needing any changes in VE.
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 :)