diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/html.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/html.go b/util/html.go new file mode 100644 index 0000000..af2ce60 --- /dev/null +++ b/util/html.go @@ -0,0 +1,14 @@ +package util + +import ( + "html/template" + "strings" +) + +func HTMLCellEscapeString(s string) template.HTML { + html := template.HTMLEscapeString(s) + if strings.TrimSpace(html) == "" { + html = " " + } + return template.HTML(html) +} |