17 lines
349 B
JavaScript
17 lines
349 B
JavaScript
const mdEmoji = require('markdown-it-emoji')
|
|
const twemoji = require('twemoji')
|
|
|
|
// ------------------------------------
|
|
// Markdown - Emoji
|
|
// ------------------------------------
|
|
|
|
module.exports = {
|
|
init (md, conf) {
|
|
md.use(mdEmoji)
|
|
|
|
md.renderer.rules.emoji = (token, idx) => {
|
|
return twemoji.parse(token[idx].content)
|
|
}
|
|
}
|
|
}
|