2018-01-15 03:05:08 +00:00
|
|
|
const mdEmoji = require('markdown-it-emoji')
|
2019-01-18 20:58:39 +00:00
|
|
|
const twemoji = require('twemoji')
|
2018-01-15 03:05:08 +00:00
|
|
|
|
|
|
|
// ------------------------------------
|
|
|
|
// 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)
|
|
|
|
}
|
2018-01-15 03:05:08 +00:00
|
|
|
}
|
|
|
|
}
|