wip: improved clause anchor links

This commit is contained in:
2026-01-11 10:00:38 +00:00
parent 9a2ae93ccf
commit 9774d59aef
11 changed files with 392 additions and 376 deletions

View File

@@ -229,10 +229,10 @@ function addClauseAnchors(list: List, prefix: string = ""): void {
// Find the first paragraph in the item and prepend an anchor link
for (const child of item.children) {
if (child.type === "paragraph") {
// Create anchor link HTML to inject
// Create anchor link HTML with clause number text
const anchorHtml: Html = {
type: "html",
value: `<a href="#${clauseId}" class="clause-link" aria-hidden="true"></a>`,
value: `<a href="#${clauseId}" class="clause-link" aria-hidden="true">${clauseNum}.</a>`,
};
// Prepend anchor to paragraph children
(child as { children: RootContent[] }).children.unshift(