Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.Compiler = node => {
parseFrontmatter(node)
console.log(node)
return toHyper(h, {
type: 'element',
tagName: 'div',
properties: {},
children: toHast(node, {
allowDangerousHTML: true,
handlers: {
html: (h, node, parent) => {
console.log(parent)
parent.type = 'element'
parent.tagName = 'React.Fragment'
}
}
}).children
})
}
}
static parseToHast(markdown) {
const mdast = remark().parse(markdown);
const hast = toHast(mdast);
return hast;
}
function nodeToHtml(node) {
const hast = toHAST(node)
return hast ? toHTML(hast) : ''
}