# html2text [![Documentation](https://godoc.org/github.com/jaytaylor/html2text?status.svg)](https://godoc.org/github.com/jaytaylor/html2text) [![Build Status](https://travis-ci.org/jaytaylor/html2text.svg?branch=master)](https://travis-ci.org/jaytaylor/html2text) [![Report Card](https://goreportcard.com/badge/github.com/jaytaylor/html2text)](https://goreportcard.com/report/github.com/jaytaylor/html2text) ### Converts HTML into text of the markdown-flavored variety ## 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 jaytaylor.com/html2text ``` ## Example usage ```go package main import ( "fmt" "jaytaylor.com/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 |