From 19fe9726a25ca96101e97ed02d0c1bac34712ba4 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Mon, 5 Mar 2012 18:06:29 +0000 Subject: [PATCH] Fix invalid external link representation. 268 tests passing. --- modules/parser/ext.core.LinkHandler.js | 2 +- tests/parser/parserTests-whitelist.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/parser/ext.core.LinkHandler.js b/modules/parser/ext.core.LinkHandler.js index 5cda09e319..747d45b5af 100644 --- a/modules/parser/ext.core.LinkHandler.js +++ b/modules/parser/ext.core.LinkHandler.js @@ -270,7 +270,7 @@ ExternalLinkHandler.prototype.onExtLink = function ( token, manager, cb ) { }; } else { return { - tokens: ['[', href ].concat( content, [']'] ) + tokens: ['[', href, ' ' ].concat( content, [']'] ) }; } }; diff --git a/tests/parser/parserTests-whitelist.js b/tests/parser/parserTests-whitelist.js index 338ffb646f..f141f4a794 100644 --- a/tests/parser/parserTests-whitelist.js +++ b/tests/parser/parserTests-whitelist.js @@ -74,6 +74,8 @@ testWhiteList["Link containing % as a single hex sequence interpreted to char"] testWhiteList["Link containing double-single-quotes '' (bug 4598)"] = "

Lista d''e paise d''o munno

"; +testWhiteList["Brackets in urls"] = "

http://example.com/index.php?foozoid[]=bar

http://example.com/index.php?foozoid[]=bar

"; + if (typeof module == "object") { module.exports.testWhiteList = testWhiteList; }