Skip to content

Commit

Permalink
chore: backtrack
Browse files Browse the repository at this point in the history
  • Loading branch information
EveSunMaple committed Dec 28, 2024
1 parent 3782b0a commit ea9e564
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/remark-heading-extractor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function remarkHeadingExtractor() {
visit(tree, 'heading', (node) => {
const rawText = toString(node);

const text = rawText.split('\n')[0].replace(/<[^>]+>/g, '').trim();
const text = rawText.split('\n')[0].replace(/<[^>]*>/g, '').trim();
const id = text.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '') + rawText.split('\n')[0].match(/href="([^"]+)"/, '')[1].trim();;

const level = node.depth;
Expand Down

0 comments on commit ea9e564

Please sign in to comment.