wikijs-fork/server/modules/rendering/markdown-emoji/renderer.js

17 lines
349 B
JavaScript
Raw Normal View History

const mdEmoji = require('markdown-it-emoji')
2019-01-18 20:58:39 +00:00
const twemoji = require('twemoji')
// ------------------------------------
// Markdown - Emoji
// ------------------------------------
module.exports = {
init (md, conf) {
md.use(mdEmoji)
2019-01-18 20:58:39 +00:00
md.renderer.rules.emoji = (token, idx) => {
return twemoji.parse(token[idx].content)
}
}
}