diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index f764f2e..9d804d5 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -1878,8 +1878,9 @@ }; for (var i in map) { var escaped = i.replace(/([()[{*+.$^\\|?])/g, '\\$1'); + escaped = "(\\s|^)(" + escaped + ")(\\s|$)"; var regex = new RegExp(escaped, 'gim'); - input = input.replace(regex, map[i]); + input = input.replace(regex, "$1" + map[i] + "$3"); } return input; }