mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
wip: improved clause anchor links
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user