# html2text [](https://pkg.go.dev/github.com/inbucket/html2text) [](https://github.com/inbucket/html2text/actions/workflows/build-and-test.yml) [](https://goreportcard.com/report/github.com/inbucket/html2text) ### Converts HTML into text of the markdown-flavored variety This is a permanent fork of the original [jaytaylor.com/html2text](https://github.com/jaytaylor/html2text) package. ## Introduction Ensure your emails are readable by all! Turns HTML into raw text, useful for sending fancy HTML emails with an equivalently nicely formatted TXT document as a fallback (e.g. for people who don't allow HTML emails or have other display issues). html2text is a simple golang package for rendering HTML into plaintext. There are still lots of improvements to be had, but FWIW this has worked fine for my [basic] HTML-2-text needs. It requires go 1.x or newer ;) ## Download the package ```bash go get github.com/inbucket/html2text ``` ## Example usage ### Library ```go package main import ( "fmt" "github.com/inbucket/html2text" ) func main() { inputHTML := `
Here is some more information:
| Header 1 | Header 2 |
|---|---|
| Footer 1 | Footer 2 |
| Row 1 Col 1 | Row 1 Col 2 |
| Row 2 Col 1 | Row 2 Col 2 |