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:
Alex Monk 2015-07-25 19:41:51 +01:00
parent 43eb2acf84
commit 5931751771

View file

@ -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() );
}
} );
};