Page MenuHomePhabricator

When auto-linking a typed magic link, make it a special link rather than a normal link
Closed, ResolvedPublic8 Estimated Story Points

Event Timeline

Not too hard, I just didn't do it right away because (a) it involves a little refactor, and (b) I wanted to hear from some users first.

Here's what you'd need to do:

  1. Refactor ve.ui.LinkAction.prototype.autolink to take an optional parameter to create the necessary transaction to create a new link/mwMagic node, instead of the default set-annotation transaction.
  2. Make ve.ui.MWLinkAction.prototype.autolinkMagicLink pass the necessary parameter.

Alternatively, you could refactor autolink to just split off the last part of the function, starting at the part which validates that the range doesn't contain any existing links. That part would move into a new autolinkImpl function (or something like that) and then ve.ui.MWLinkAction could override autolinkImpl to tweak the validation and transaction application in the magic link case. This would be a bit more general than the above approach, but would involve more code duplication.

Change 238607 had a related patch set uploaded (by Cscott):
Refactor ve.ui.LinkAction to allow autolinking to create nodes

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

Change 238608 had a related patch set uploaded (by Cscott):
[PULLTHROUGH] Autolink of magic links should create node not annotation

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

Change 238607 merged by jenkins-bot:
Refactor ve.ui.LinkAction to allow autolinking to create nodes

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

Change 238608 merged by jenkins-bot:
Autolink of magic links should create node not annotation

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