fix: toc issue with remark-autolink-headings

This commit is contained in:
Ahmet ALMAZ 2021-08-09 13:57:12 +03:00
parent 08fb1d4690
commit 52aaf99dd7

View File

@ -4,8 +4,8 @@ module.exports = function (options) {
return (tree) =>
visit(tree, 'heading', (node, index, parent) => {
options.exportRef.push({
value: node.children[1].value,
url: node.children[0].url,
value: node.children[0].value || node.children[1].value,
url: node.children[0].url || node.children[1].url,
depth: node.depth,
})
})