diff options
Diffstat (limited to 'communities/red-right-hand/174bg.net/public')
| -rw-r--r-- | communities/red-right-hand/174bg.net/public/handbook/index.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/communities/red-right-hand/174bg.net/public/handbook/index.html b/communities/red-right-hand/174bg.net/public/handbook/index.html index 69140d2..ab992bd 100644 --- a/communities/red-right-hand/174bg.net/public/handbook/index.html +++ b/communities/red-right-hand/174bg.net/public/handbook/index.html @@ -596,6 +596,13 @@ headings.forEach((heading) => { const level = parseInt(heading.tagName[1]); + if (!heading.id) { + heading.id = heading.textContent + .trim() + .toLowerCase() + .replace(/[^\w\s-]/g, "") + .replace(/\s+/g, "-"); + } const tocLink = document.createElement("a"); tocLink.textContent = heading.textContent; tocLink.href = `#${heading.id}`; |
