wikijs-fork/server/modules/rendering/markdown-emoji/renderer.js
2019-01-18 15:58:39 -05:00

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)
}
}
}