From d16b4487d5061174d7e9c45d7bac9883b03b7d15 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 10 Jan 2014 13:04:15 -0500 Subject: [PATCH] Applied markdown-js fixes from upstream --- vendor/assets/javascripts/better_markdown.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/assets/javascripts/better_markdown.js b/vendor/assets/javascripts/better_markdown.js index 38e3ef7820b..7c0e7523f98 100644 --- a/vendor/assets/javascripts/better_markdown.js +++ b/vendor/assets/javascripts/better_markdown.js @@ -1211,6 +1211,9 @@ "![": function image( text ) { + // Without this guard V8 crashes hard on the RegExp + if (text.indexOf('(') >= 0 && text.indexOf(')') === -1) { return; } + // Unlike images, alt text is plain text only. no other elements are // allowed in there