From 1514d166e06851ffee3d8ea2735c5b5b8b8168ab Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 16 Mar 2015 00:14:38 +0100 Subject: [PATCH] Insert link: trim whitespace from the external link Bug: T25499 Change-Id: I2392ade17d3d4428784c40dabf9ae5e216fbab47 --- modules/jquery.wikiEditor.dialogs.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 7b543538..ac2be495 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -471,6 +471,7 @@ $.wikiEditor.modules.dialogs.config = { else insertText = '[[' + target + '|' + escapeInternalText( text ) + ']]'; } else { + target = $.trim( target ); // Prepend http:// if there is no protocol if ( !target.match( /^[a-z]+:\/\/./ ) ) target = 'http://' + target;