summaryrefslogtreecommitdiff
path: root/src/html/template/html.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/html/template/html.go')
-rw-r--r--src/html/template/html.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/html/template/html.go b/src/html/template/html.go
index bcca0b51a0..a181699a5b 100644
--- a/src/html/template/html.go
+++ b/src/html/template/html.go
@@ -14,6 +14,9 @@ import (
// htmlNospaceEscaper escapes for inclusion in unquoted attribute values.
func htmlNospaceEscaper(args ...any) string {
s, t := stringify(args...)
+ if s == "" {
+ return filterFailsafe
+ }
if t == contentTypeHTML {
return htmlReplacer(stripTags(s), htmlNospaceNormReplacementTable, false)
}