fix: correctly fix missing +1, -1 (#1722)

This commit is contained in:
ChoKaPeek
2022-01-14 17:56:28 +08:00
committed by GitHub
parent c1227b22cb
commit 719dcbea5c
+1 -3
View File
@@ -12,11 +12,9 @@ function replace(m, $1) {
export function emojify(text) {
return text
.replace(/:\+1:/g, ':thumbsup:')
.replace(/:-1:/g, ':thumbsdown:')
.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, m =>
m.replace(/:/g, '__colon__')
)
.replace(/:(\w+?):/gi, (inBrowser && window.emojify) || replace)
.replace(/:([a-z0-9_\-\+]+?):/g, (inBrowser && window.emojify) || replace)
.replace(/__colon__/g, ':');
}