diff --git a/content_script.js b/content_script.js index c72581e..44dc8f7 100644 --- a/content_script.js +++ b/content_script.js @@ -24,9 +24,12 @@ const replaceAll = () => { } const escapeAndReplace = (input_word, replace_value, case_sensitive) => { - const input_word_escaped = escapeRegExp(input_word.trim()) + let input_word_escaped = escapeRegExp(input_word.trim()) const flags = case_sensitive ? "g" : "ig" - const regexp_input_word = new RegExp(`\\b${input_word_escaped}\\b`, flags) + if (!input_word_escaped.startsWith('\\')) { + input_word_escaped = `\\b${input_word_escaped}\\b` + } + const regexp_input_word = new RegExp(input_word_escaped, flags) replace(regexp_input_word, replace_value) } diff --git a/manifest.json b/manifest.json index 21cc8b9..7ea4ef3 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "manifest_version": 2, "name": "InteractiveFics", "author": "mariamrf", - "version": "5.0", + "version": "5.0.1", "description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.", "browser_action": { "default_title": "InteractiveFics",