Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StripTags ¶
StripTags converts HTML to plain text with no live HTML tag in it. It turns block-level tags (p, div, br, etc.) into newlines to preserve paragraph structure, strips the remaining tags, decodes one level of entities, and cleans up whitespace.
Markup that was entity-encoded ("<img ...>") becomes a tag once decoded, so complete tags are stripped again after decoding and any leftover "<" that would open a tag is dropped. Escaped prose such as "a < b" still decodes to "a < b". Deeper encodings ("&lt;b&gt;") decode one level to inert text ("<b>"). The result is plain text, not safe HTML: every consumer that writes it into HTML must still escape it.
Types ¶
This section is empty.