From f289b7f13a1dfc7c096b13b5f194aa61dc14075f Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 24 Jan 2026 21:30:35 +0700 Subject: all: add aria-label to the anchor when sectanchor enabled The aria-label help user with screen reader to discern and navigate the anchor. Ref: https://dequeuniversity.com/rules/axe/4.11/link-name --- html_backend.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'html_backend.go') diff --git a/html_backend.go b/html_backend.go index 14137e5..323b60b 100644 --- a/html_backend.go +++ b/html_backend.go @@ -1167,7 +1167,9 @@ func htmlWriteSection(doc *Document, el *element, out io.Writer) { _, withSectAnchors = doc.Attributes.Entry[docAttrSectAnchors] if withSectAnchors { - fmt.Fprintf(out, ``, el.ID) + fmt.Fprintf(out, + ``, + el.ID, el.ID) } _, withSectlinks = doc.Attributes.Entry[docAttrSectLinks] if withSectlinks { -- cgit v1.3