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 724b026
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 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,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')
}
}
}

0 comments on commit 724b026

Please sign in to comment.