From c4488b1c19d7e82c078d78c12d42894fd9be2173 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Thu, 14 May 2026 22:15:14 +0100 Subject: dynamic ids to each header --- communities/red-right-hand/174bg.net/public/handbook/index.html | 7 +++++++ 1 file changed, 7 insertions(+) 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}`; -- cgit v1.2.3