jaytaylor / html2text

Golang HTML to plaintext conversion library
https://jaytaylor.com/html2text
MIT License
541 stars 138 forks source link

Example code doesn't work #26

Closed tjaensch closed 6 years ago

tjaensch commented 6 years ago

It's producing the following errors:

./test.go:6:2: imported and not used: "github.com/jaytaylor/html2text" ./test.go:50:15: undefined: FromString ./test.go:50:37: undefined: Options

This is the code from your README example:

package main

import ( "fmt"

"github.com/jaytaylor/html2text"

)

func main() { inputHTML := `

My Mega Service

Welcome to your new account on my service!

Here is some more information:

Header 1Header 2
Footer 1Footer 2
Row 1 Col 1Row 1 Col 2
Row 2 Col 1Row 2 Col 2
` text, err := FromString(inputHTML, Options{PrettyTables: true}) if err != nil { panic(err) } fmt.Println(text) }
jaytaylor commented 6 years ago

Hi @tjaensch, thanks for letting me know about this. The package named was missing from the FromString and Options references (e.g. should be html2text.FromString, and html2text.Options).

I just merged the fix #27

Thanks again, take care. Please close this if you agree the problem is solved.