diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-02-06 22:02:21 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-02-06 22:02:21 -0500 |
commit | d69f0d57bca7761d9cc3810973cc06cc357c49fe (patch) | |
tree | 4a89ba676365210127155b49d520af8b01694fc9 /util | |
parent | e2b6ec92921a2d43f77015f0e75c362a03430e76 (diff) |
*-pem2html: Correctly render empty cells (made possible by recent changes)
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) +} |