mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
MWExternalLinkAnnotation: Only match plain external <a>s with hrefs
We now accept non-Parsoid generated external links from paste, so make sure they have href attributes otherwise they aren't really external links and will throw exceptions later on. Bug: T131430 Change-Id: Ifb565b1ce30cfe80ae72b17f6a9551ea40b36453
This commit is contained in:
parent
4dadaa677c
commit
6fad9ecdee
|
@ -35,8 +35,8 @@ ve.dm.MWExternalLinkAnnotation.static.name = 'link/mwExternal';
|
|||
|
||||
ve.dm.MWExternalLinkAnnotation.static.matchFunction = function ( domElement ) {
|
||||
var rel = domElement.getAttribute( 'rel' );
|
||||
// Match explicity mw:ExtLink, or plain RDFa-less links (e.g. from external paste)
|
||||
return !rel || rel === 'mw:ExtLink';
|
||||
// Match explicity mw:ExtLink, or plain RDFa-less links with an href (e.g. from external paste)
|
||||
return ( !rel && domElement.hasAttribute( 'href' ) ) || rel === 'mw:ExtLink';
|
||||
};
|
||||
|
||||
ve.dm.MWExternalLinkAnnotation.static.toDataElement = function ( domElements, converter ) {
|
||||
|
|
Loading…
Reference in a new issue