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