Skip to content

Commit

Permalink
use unicode escape for backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
mnater committed Aug 4, 2020
1 parent 9957ce6 commit 41fa8d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hyphenopoly.js
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
if (!H.languages) {
H.languages = new Map();
}
alphabet = alphabet.replace(/-/g, "\\-");
alphabet = alphabet.replace(/-/g, "\u005c-");
H.languages.set(lang, {
alphabet,
"cache": new Map(),
Expand Down
2 changes: 1 addition & 1 deletion hyphenopoly.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function prepareLanguagesObj(
patternLeftmin,
patternRightmin
) {
alphabet = alphabet.replace(/-/g, "\\-");
alphabet = alphabet.replace(/-/g, "\u005c-");
const lo = createLangObj(lang);
if (!lo.engineReady) {
lo.cache = new Map();
Expand Down

0 comments on commit 41fa8d9

Please sign in to comment.