Insert link: trim whitespace from the external link

Bug: T25499
Change-Id: I2392ade17d3d4428784c40dabf9ae5e216fbab47
This commit is contained in:
Derk-Jan Hartman 2015-03-16 00:14:38 +01:00
parent 2c3fe04ce1
commit 1514d166e0

View file

@ -471,6 +471,7 @@ $.wikiEditor.modules.dialogs.config = {
else else
insertText = '[[' + target + '|' + escapeInternalText( text ) + ']]'; insertText = '[[' + target + '|' + escapeInternalText( text ) + ']]';
} else { } else {
target = $.trim( target );
// Prepend http:// if there is no protocol // Prepend http:// if there is no protocol
if ( !target.match( /^[a-z]+:\/\/./ ) ) if ( !target.match( /^[a-z]+:\/\/./ ) )
target = 'http://' + target; target = 'http://' + target;