This is a Go package containing an extracted version of the unexported stripTags function in html/template/html.go.
- The
stripTagsfunction inhtml/template/html.gois very useful, however, it is not exported. - Requests were made on GitHub without success.
- This package is a repo for work done by Christopher Hesse provided in this Gist.
$ go get github.com/grokify/html-strip-tags-goimport( "github.com/grokify/html-strip-tags-go" // => strip ) func main() { original := "<h1>Hello World</h1>" stripped := strip.StripTags(original) // => "Hello World" }