code: func chunksToHTML(chunks []formatChunk) template.HTML {
  	buf := bytes.Buffer{}
  	for _, chunk := range chunks {
  		if len(chunk.html) != 0 {
  			buf.WriteString(string(chunk.html))
  		} else {
  			buf.WriteString(template.HTMLEscapeString(chunk.str))
  		}
  	}
  	return template.HTML(buf.String())
  }
docs: // chunksToHTML concatenates chunks together, escaping as needed, to return a
  // final completed HTML string.