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
This commit is contained in:
David Lynch 2019-05-14 14:13:44 -05:00
parent 3285b7dbe5
commit c66f8e0547

View file

@ -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: {