From 378b594b2de4b28252d497e6bdb4ea79fbd7d609 Mon Sep 17 00:00:00 2001 From: balpha Date: Sun, 24 Feb 2013 14:13:00 +0100 Subject: [PATCH] apparently discourse allows single-quoted attribute values in HTML; fix the lookahead in the PageDown auto-linker to account for that --- app/assets/javascripts/external/Markdown.Converter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/external/Markdown.Converter.js b/app/assets/javascripts/external/Markdown.Converter.js index 5ae53d3174f..22808c5b351 100644 --- a/app/assets/javascripts/external/Markdown.Converter.js +++ b/app/assets/javascripts/external/Markdown.Converter.js @@ -1270,7 +1270,7 @@ else // must be preceded by a non-word character (and not by =" or <) and followed by non-word/EOF character // simulating the lookbehind in a consuming way is okay here, since a URL can neither and with a " nor // with a <, so there is no risk of overlapping matches. - text = text.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens); + text = text.replace(/(="|='|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens); // autolink anything like