all repos — flounder @ cbb04214d323a3fc4e0d562ef60fb08737ba6e28

A small site builder for the Gemini protocol

Re-add preformatted alt text
alex wennerberg alex@alexwennerberg.com
Mon, 09 Nov 2020 10:05:03 -0800
commit

cbb04214d323a3fc4e0d562ef60fb08737ba6e28

parent

fe128dfe1438dd8da1e03851f6b77a938665d7ea

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M gmi2html.gogmi2html.go

@@ -34,6 +34,11 @@ fmt.Fprintf(&b, "<p><a href='%s'>%s</a></p>\n", url, name)

case gemini.LinePreformattingToggle: pre = !pre if pre { + altText := string(l.(gemini.LinePreformattingToggle)) + if altText != "" { + altText = html.EscapeString(altText) + fmt.Fprintf(&b, "<pre title='%s'>\n", altText) + } fmt.Fprint(&b, "<pre>\n") } else { fmt.Fprint(&b, "</pre>\n")