feat: twemoji + headers fix

This commit is contained in:
Nicolas Giard
2019-01-18 15:58:39 -05:00
parent 86c6aabebd
commit 1771289188
8 changed files with 65 additions and 44 deletions

View File

@@ -14,6 +14,6 @@ module.exports = {
renderer.init($, child.config)
}
return $.html()
return $.html('body').replace('<body>', '').replace('</body>', '')
}
}

View File

@@ -0,0 +1,8 @@
key: htmlTwemoji
title: Twemoji
description: Apply Twitter Emojis to all Unicode emojis
author: requarks.io
icon: whatshot
enabledDefault: true
dependsOn: htmlCore
props: {}

View File

@@ -0,0 +1,9 @@
// ------------------------------------
// HTML - Twemoji
// ------------------------------------
module.exports = {
init ($, conf) {
}
}

View File

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