parent
999d560703
commit
e3debcc5e1
|
@ -9,7 +9,7 @@ export function replaceEmoji (string, replacer) {
|
||||||
|
|
||||||
function safeReplacer (substring) {
|
function safeReplacer (substring) {
|
||||||
// emoji regex matches digits and pound sign https://git.io/fpl6J
|
// emoji regex matches digits and pound sign https://git.io/fpl6J
|
||||||
if (substring.match(/^[0-9#*]+$/)) {
|
if (substring.match(/^[0-9#*™®]+$/)) {
|
||||||
return substring
|
return substring
|
||||||
}
|
}
|
||||||
return replacer(substring)
|
return replacer(substring)
|
||||||
|
|
|
@ -67,8 +67,8 @@ describe('test-emoji.js', function () {
|
||||||
`it's over #9000`
|
`it's over #9000`
|
||||||
)
|
)
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`, replacer),
|
replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`, replacer),
|
||||||
`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`
|
`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue