diff --git a/gatsby-theme-oi-wiki/plugins/rehype-footnote-heading/index.js b/gatsby-theme-oi-wiki/plugins/rehype-footnote-heading/index.js index ca0058cf0..d458187f7 100644 --- a/gatsby-theme-oi-wiki/plugins/rehype-footnote-heading/index.js +++ b/gatsby-theme-oi-wiki/plugins/rehype-footnote-heading/index.js @@ -5,12 +5,13 @@ module.exports = function () { visit(ast, 'element', function (node, index, parent) { if (node.tagName !== 'h2') return if (node.properties['id'] !== 'footnote-label') return - - parent[index] = { - type: 'element', - tagName: 'hr', - properties: node.properties + const properties = node.properties + for (const i of Object.keys(node)) { + delete node[i] } - }) + node.type = 'element' + node.tagName = 'hr' + node.properties = properties + node.properties['className'].push('MuiDivider-root', 'makeStyles-divider-4') } -} \ No newline at end of file +}