1 2 3 4 5 6 7 8 9 10 11 12 13 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) }