From cbc2a201248921c16245afda4347a86a6a4deb17 Mon Sep 17 00:00:00 2001 From: spencer Date: Sat, 14 Oct 2017 23:49:56 -0400 Subject: [PATCH] Added additional regex string escape characters (as per https://stackoverflow.com/a/6969486) -- Question marks in attribute values were causing failure to parse the shortcodes, e.g. [mytag myattribute="What?"] --- src/Shortcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shortcode.js b/src/Shortcode.js index 7bab823..7cb675b 100644 --- a/src/Shortcode.js +++ b/src/Shortcode.js @@ -165,7 +165,7 @@ Shortcode.prototype.parseOptions = function(stringOptions) { }; Shortcode.prototype.escapeTagRegExp = function(regex) { - return regex.replace(/[\[\]\/]/g, '\\$&'); + return regex.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); }; Shortcode.prototype.template = function(s, d) {