fix(emoji): fix ™® characters treated as emoji (#682)

fixes #679
This commit is contained in:
Nolan Lawson 2018-11-23 21:32:57 -08:00 committed by GitHub
parent 999d560703
commit e3debcc5e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -67,8 +67,8 @@ describe('test-emoji.js', function () {
`it's over #9000`
)
assert.strictEqual(
replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`, replacer),
`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`
replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`, replacer),
`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`
)
})