diff --git a/vendor/assets/javascripts/better_markdown.js b/vendor/assets/javascripts/better_markdown.js index 6d831e5e4d0..ed454e97363 100644 --- a/vendor/assets/javascripts/better_markdown.js +++ b/vendor/assets/javascripts/better_markdown.js @@ -1349,11 +1349,13 @@ return [ consumed, link ]; } - m = text.match(new RegExp("^\\((" + urlRegexp + ")\\)")); - if (m && m[1]) { - consumed += m[0].length; - link = ["link", {href: m[1]}].concat(children); - return [consumed, link]; + if (text.indexOf('(') === 0 && text.indexOf(')') !== -1) { + m = text.match(new RegExp("^\\((" + urlRegexp + ")\\)")); + if (m && m[1]) { + consumed += m[0].length; + link = ["link", {href: m[1]}].concat(children); + return [consumed, link]; + } } // [Alt text][id]