diff --git a/routes/_utils/replaceEmoji.js b/routes/_utils/replaceEmoji.js index b27f3c0..1abdf42 100644 --- a/routes/_utils/replaceEmoji.js +++ b/routes/_utils/replaceEmoji.js @@ -9,7 +9,7 @@ export function replaceEmoji (string, replacer) { function safeReplacer (substring) { // emoji regex matches digits and pound sign https://git.io/fpl6J - if (substring.match(/^[0-9#*]+$/)) { + if (substring.match(/^[0-9#*™®]+$/)) { return substring } return replacer(substring) diff --git a/tests/unit/test-emoji.js b/tests/unit/test-emoji.js index d827120..8da04b2 100644 --- a/tests/unit/test-emoji.js +++ b/tests/unit/test-emoji.js @@ -67,8 +67,8 @@ describe('test-emoji.js', function () { `it's over #9000` ) assert.strictEqual( - replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`, replacer), - `woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£` + replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`, replacer), + `woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®` ) })