mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-29 18:48:14 +08:00
fix: correctly fix missing +1, -1 (#1722)
This commit is contained in:
parent
c1227b22cb
commit
719dcbea5c
@ -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, ':');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user