mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Trim external link before validating
We already trim it before setting it as the actual annotation href Bug: T103450 Change-Id: I4c7117d7e1e89c98abbafb999033ab7b5f58bdff
This commit is contained in:
parent
43eb2acf84
commit
5931751771
|
@ -55,6 +55,8 @@ ve.ui.MWExternalLinkAnnotationWidget.static.getAnnotationFromText = function ( v
|
|||
ve.ui.MWExternalLinkAnnotationWidget.prototype.createInputWidget = function () {
|
||||
return new OO.ui.TextInputWidget( {
|
||||
icon: 'linkExternal',
|
||||
validate: ve.init.platform.getExternalLinkUrlProtocolsRegExp()
|
||||
validate: function ( text ) {
|
||||
return !!ve.init.platform.getExternalLinkUrlProtocolsRegExp().exec( text.trim() );
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue