Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedee authored Jun 15, 2021
2 parents e972f3c + ec0be0b commit 2fbfcec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ function generateToc(markdown) {
// Note: character range in regex is roughly "word characters including accented" (eg: bublé)
const id = text
.toLowerCase()
.replace(/[\s-!()<>`'"&,]+/g, '-');
.replace(/[\s-!()<>`'"&,]+/g, '-')
.replace(/(?:^-|-$)/g, '');
toc.push({ text, id, level });
}
return toc;
Expand Down

0 comments on commit 2fbfcec

Please sign in to comment.