From c66f8e0547cb9f436eefaaa9293ffcfd06faae89 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Tue, 14 May 2019 14:13:44 -0500 Subject: [PATCH] MWInternalLinkAnnotation: handle non-internal links that say they're mw:WikiLink The likely case for this is: copying from within VE in one wiki, and pasting into VE in another wiki. This change will notice this happening, and fall back to treat it as an external link. (For the wiki-internal links, this will turn them into interwiki links rather than raw external links.) Bug: T223322 Change-Id: Ie0157fc3aee6e5fd9973a2889be7ebd287bc90a5 --- .../ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js index fb724dd514..85e1035e64 100644 --- a/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js +++ b/modules/ve-mw/dm/annotations/ve.dm.MWInternalLinkAnnotation.js @@ -45,6 +45,10 @@ ve.dm.MWInternalLinkAnnotation.static.toDataElement = function ( domElements, co ); } + if ( !targetData.isInternal ) { + return ve.dm.MWExternalLinkAnnotation.static.toDataElement( domElements, converter ); + } + return { type: this.name, attributes: {