feat(emojify): add no-emoji option
This commit is contained in:
parent
37daa7ef9c
commit
3aef37a445
4 changed files with 22 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ const config = merge({
|
|||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: ''
|
||||
}, window.$docsify)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ function replace (m, $1) {
|
|||
}
|
||||
|
||||
export function emojify (text) {
|
||||
return text
|
||||
return $docsify.noEmoji ? text : text
|
||||
.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, m => m.replace(/:/g, '__colon__'))
|
||||
.replace(/:(\w+?):/ig, window.emojify || replace)
|
||||
.replace(/__colon__/g, ':')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue