-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Seem like this code:
Should be part of this plugin, especially considering the regex for building the ID could change here but not there, thus breaking the anchor links:
bit-docs-html-toc/make-tree.js
Lines 53 to 58 in 65eda42
function makeHeadingId(text) { | |
return (text || "") | |
.replace(/\s/g, "-") // replace spaces with dashes | |
.replace(/[^\w\-]/g, "") // remove punctuation | |
.toLowerCase(); | |
} |
Also, it's something needed for any bit-docs website that wants to include this plugin, so why not implement here rather than re-implement it in every bit-docs website?
Adding of IDs could be toggled on/off with a setting if needed, and it could be smart enough to use any existing IDs on the header elements, or smart enough to enumerate for headings with the same contents on the same page (thus otherwise having identically generated IDs).
Activity