From 1d114721365517fcacacf09e40c79588121e3060 Mon Sep 17 00:00:00 2001 From: Virgil Date: Tue, 31 Mar 2026 20:51:01 +0000 Subject: [PATCH] feat(html): add role accessibility helper Co-Authored-By: Virgil --- docs/architecture.md | 1 + docs/index.md | 4 ++-- node.go | 6 ++++++ node_test.go | 9 +++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 2fd2751..169dc36 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -27,6 +27,7 @@ All concrete node types are unexported structs with exported constructor functio | `AltText(Node, text)` | Convenience helper that sets `alt` on an element node. | | `TabIndex(Node, index)` | Convenience helper that sets `tabindex` on an element node. | | `AutoFocus(Node)` | Convenience helper that sets `autofocus` on an element node. | +| `Role(Node, role)` | Convenience helper that sets `role` on an element node. | | `Text(key, ...any)` | Translated text via the active context translator. Server builds fall back to global `go-i18n`; JS builds fall back to the key. Output is always HTML-escaped. | | `Raw(content)` | Unescaped trusted content. Explicit escape hatch. | | `If(cond, Node)` | Renders the child only when the condition function returns true. | diff --git a/docs/index.md b/docs/index.md index 24e8a67..2d3385f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -39,7 +39,7 @@ This builds a Header-Content-Footer layout with semantic HTML elements (`
` (H), `