refactor(core): and markdown compiler
This commit is contained in:
parent
30da0d5d46
commit
fe88c154b0
12 changed files with 194 additions and 232 deletions
6
src/core/render/emojify.js
Normal file
6
src/core/render/emojify.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export function emojify (text) {
|
||||
return text
|
||||
.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, m => m.replace(/:/g, '__colon__'))
|
||||
.replace(/:(\w+?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
|
||||
.replace(/__colon__/g, ':')
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue