feat: twemoji + headers fix
This commit is contained in:
@@ -14,6 +14,6 @@ module.exports = {
|
||||
renderer.init($, child.config)
|
||||
}
|
||||
|
||||
return $.html()
|
||||
return $.html('body').replace('<body>', '').replace('</body>', '')
|
||||
}
|
||||
}
|
||||
|
8
server/modules/rendering/html-twemoji/definition.yml
Normal file
8
server/modules/rendering/html-twemoji/definition.yml
Normal 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: {}
|
9
server/modules/rendering/html-twemoji/renderer.js
Normal file
9
server/modules/rendering/html-twemoji/renderer.js
Normal file
@@ -0,0 +1,9 @@
|
||||
// ------------------------------------
|
||||
// HTML - Twemoji
|
||||
// ------------------------------------
|
||||
|
||||
module.exports = {
|
||||
init ($, conf) {
|
||||
|
||||
}
|
||||
}
|
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user