fix: html rendering order param + decodeEntities

This commit is contained in:
NGPixel 2020-01-03 01:07:29 -05:00
parent edd11cd73f
commit 0755c538ed
4 changed files with 15 additions and 5 deletions

View File

@ -8,7 +8,9 @@ const URL = require('url').URL
module.exports = { module.exports = {
async render() { async render() {
const $ = cheerio.load(this.input) const $ = cheerio.load(this.input, {
decodeEntities: false
})
if ($.root().children().length < 1) { if ($.root().children().length < 1) {
return '' return ''
@ -230,9 +232,9 @@ module.exports = {
// STEP: POST // STEP: POST
// -------------------------------- // --------------------------------
for (let child of _.filter(this.children, ['step', 'post'])) { for (let child of _.sortBy(_.filter(this.children, ['step', 'post']), ['order'])) {
const renderer = require(`../${_.kebabCase(child.key)}/renderer.js`) const renderer = require(`../${_.kebabCase(child.key)}/renderer.js`)
output = renderer.init(output, child.config) output = await renderer.init(output, child.config)
} }
return output return output

View File

@ -6,6 +6,7 @@ icon: mdi-fire
enabledDefault: true enabledDefault: true
dependsOn: htmlCore dependsOn: htmlCore
step: post step: post
order: 99999
props: props:
safeHTML: safeHTML:
type: Boolean type: Boolean

View File

@ -5,4 +5,6 @@ author: requarks.io
icon: mdi-emoticon-happy-outline icon: mdi-emoticon-happy-outline
enabledDefault: true enabledDefault: true
dependsOn: htmlCore dependsOn: htmlCore
step: post
order: 10
props: {} props: {}

View File

@ -1,9 +1,14 @@
// const twemoji = require('twemoji')
// ------------------------------------ // ------------------------------------
// HTML - Twemoji // HTML - Twemoji
// ------------------------------------ // ------------------------------------
module.exports = { module.exports = {
init ($, conf) { init (input, conf) {
// TODO: Must limit to text nodes only (exclude code blocks, already processed emojis, etc.)
//
// return twemoji.parse(input)
return input
} }
} }