Home

Awesome

HTML StripTags for Go

Used By Build Status Go Report Card Docs License

This is a Go package containing an extracted version of the unexported stripTags function in html/template/html.go.

:warning: This package does not protect against untrusted input. Please use bluemonday if you have untrusted data :warning:

Background

Installation

$ go get github.com/grokify/html-strip-tags-go

Usage

import(
    "github.com/grokify/html-strip-tags-go" // => strip
)

func main() {
    original := "<h1>Hello World</h1>"
    stripped := strip.StripTags(original) // => "Hello World"
}