You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
349 B

  1. const mdEmoji = require('markdown-it-emoji')
  2. const twemoji = require('twemoji')
  3. // ------------------------------------
  4. // Markdown - Emoji
  5. // ------------------------------------
  6. module.exports = {
  7. init (md, conf) {
  8. md.use(mdEmoji)
  9. md.renderer.rules.emoji = (token, idx) => {
  10. return twemoji.parse(token[idx].content)
  11. }
  12. }
  13. }