Skip to content

ratrocket/html-strip-tags-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML StripTags for Go

(May 2021) moved to md0.org/html-strip-tags-go. Use import md0.org/html-strip-tags-go

Go Report Card Build Status Code Climate Docs License

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

Foreground

This is forked from github.com/grokify/html-strip-tags-go

Background

  • The stripTags function in html/template/html.go is 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.

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"
}

About

export stripTags from html/template as strip.StripTags

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%