Fixed:
* html/template requires escaping comments you explicitly want rendered
  as a template.HTML type.
This commit is contained in:
brent saner
2025-12-18 02:18:05 -05:00
parent 1a4549ea72
commit be8386c73a
2 changed files with 14 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package server
import (
`fmt`
`html/template`
`net/url`
)
@@ -62,3 +63,15 @@ func (p *Page) RenderIP(indent uint) (s string) {
return
}
func (p *Page) RenderReqId() (s template.HTML) {
s = template.HTML(
fmt.Sprintf(
"<!-- Request ID: %s -->",
p.ReqUUID.String(),
),
)
return
}

View File

@@ -4,7 +4,7 @@
{{- $linkico := "🔗" -}}
<!DOCTYPE html>
<html lang="en">
<!-- Request ID: {{ .ReqUUID.String }} -->
{{ $page.RenderReqId }}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ getTitle $page.PageType }}</title>