Merge pull request #181 from Music47ell/master

fix: toc issue with remark-autolink-headings
This commit is contained in:
Timothy 2021-08-09 19:17:18 +08:00 committed by GitHub
commit b0253c2a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,
})
})