Support emoji, closed #61
This commit is contained in:
parent
7c4b0b7c74
commit
ccdc3c855a
4 changed files with 12 additions and 1 deletions
|
|
@ -63,6 +63,10 @@ export function init (options) {
|
|||
return `<p>${text}</p>`
|
||||
}
|
||||
|
||||
renderer.text = function (text) {
|
||||
return text.replace(/:(\S*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
|
||||
}
|
||||
|
||||
if (typeof OPTIONS.markdown === 'function') {
|
||||
markdown.setOptions({ renderer })
|
||||
markdown = OPTIONS.markdown.call(this, markdown)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue