Use aria-label for inaccessible <pre> text Treat preformatted text with non-empty alt text as inaccessible and provide the alt text in the aria-label attribute.
1 files changed, 7 insertions(+), 1 deletions(-) M main.go
M main.go => main.go +7 -1
@@ 89,7 89,13 @@ func (h *HTMLWriter) Handle(line gemini.Line) { case gemini.LinePreformattingToggle: h.pre = !h.pre if h.pre { fmt.Fprint(h.out, "<pre>\n") alt := strings.TrimSpace(string(line)) if alt != "" { alt = html.EscapeString(alt) fmt.Fprintf(h.out, "<pre aria-label='%s'>\n", alt) } else { fmt.Fprint(h.out, "<pre>\n") } } else { fmt.Fprint(h.out, "</pre>\n") }