Skip to content

Commit

Permalink
fix: fix footnote heading plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Enter-tainer committed Nov 13, 2021
1 parent dda2025 commit 95d584b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions gatsby-theme-oi-wiki/plugins/rehype-footnote-heading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ 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')
})
}
}
}

0 comments on commit 95d584b

Please sign in to comment.