Package htmlimg provides tool for working with the HTML element, for the Go programming language.
- Go 100%
| go.mod | ||
| LICENSE | ||
| README.md | ||
| replaceallwithalt.go | ||
| replaceallwithalt_test.go | ||
go-htmlimg
Package htmlimg provides tool for working with the HTML <img> element, for the Go programming language.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/codeberg.org/reiver/go-htmlimg
Example
Here is an example replacing all the HTML <img> elements with its alt text:
import "codeberg.org/reiver/go-htmlimg"
// ...
var html string = `<h1>Hello <img src="planet.png" alt="World" /></h1>`
replaced := htmlimg.ReplaceAllWithAlt(html)
// replaced == "<h1>Hello World</h1>"
Import
To import package htmlimg use import code like the following:
import "codeberg.org/reiver/go-htmlimg"
Installation
To install package htmlimg do the following:
GOPROXY=direct go get codeberg.org/reiver/go-htmlimg
Author
Package htmlimg was written by Charles Iliya Krempeaux