v0.2.2
Fixed: * html/template requires escaping comments you explicitly want rendered as a template.HTML type.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user