From a7cb139238b406b373383e459701524b4451c8bc Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Sat, 23 Nov 2013 23:15:40 +0100 Subject: [PATCH 1/2] support dollar sign in inline dialects In this way it is possible to use the dollar ($) sign as a startpoint for an inline dialect. --- vendor/assets/javascripts/better_markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/assets/javascripts/better_markdown.js b/vendor/assets/javascripts/better_markdown.js index 443ebd27362..11d125d7caf 100644 --- a/vendor/assets/javascripts/better_markdown.js +++ b/vendor/assets/javascripts/better_markdown.js @@ -335,7 +335,7 @@ // __foo__ is reserved and not a pattern if ( i.match( /^__.*__$/) ) continue; - var l = i.replace( /([\\.*+?|()\[\]{}])/g, "\\$1" ) + var l = i.replace( /([\\.*+?|()\[\]${}])/g, "\\$1" ) .replace( /\n/, "\\n" ); patterns.push( i.length === 1 ? l : "(?:" + l + ")" ); } From af2d854be501f1f71f98b2d04700adfc5cba3e4b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 28 Nov 2013 00:00:02 +0100 Subject: [PATCH 2/2] Also added the caret symbol, for completeness. In this way all ascii symbols are allowed. --- vendor/assets/javascripts/better_markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/assets/javascripts/better_markdown.js b/vendor/assets/javascripts/better_markdown.js index 11d125d7caf..0bfeb29ed4b 100644 --- a/vendor/assets/javascripts/better_markdown.js +++ b/vendor/assets/javascripts/better_markdown.js @@ -335,7 +335,7 @@ // __foo__ is reserved and not a pattern if ( i.match( /^__.*__$/) ) continue; - var l = i.replace( /([\\.*+?|()\[\]${}])/g, "\\$1" ) + var l = i.replace( /([\\.*+?^$|()\[\]{}])/g, "\\$1" ) .replace( /\n/, "\\n" ); patterns.push( i.length === 1 ? l : "(?:" + l + ")" ); }