summaryrefslogtreecommitdiff
path: root/util/html.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-02-06 22:02:21 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-02-06 22:02:21 -0500
commitd69f0d57bca7761d9cc3810973cc06cc357c49fe (patch)
tree4a89ba676365210127155b49d520af8b01694fc9 /util/html.go
parente2b6ec92921a2d43f77015f0e75c362a03430e76 (diff)
*-pem2html: Correctly render empty cells (made possible by recent changes)
Diffstat (limited to 'util/html.go')
-rw-r--r--util/html.go14
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 = "&nbsp;"
+ }
+ return template.HTML(html)
+}