INNER CODE UNIT · Go
ConvertReader
JohannesKaufmann/html-to-markdown · convert.go:29
func ConvertReader(r io.Reader, opts ...converter.ConvertOptionFunc) ([]byte, error) {
conv := converter.NewConverter(
converter.WithPlugins(
base.NewBasePlugin(),
commonmark.NewCommonmarkPlugin(),
),
)
return conv.ConvertReader(r, opts...)
}
// ConvertNode converts a `*html.Node` to a markdown byte slice.
//
// If you have already parsed an HTML page using the `html.Parse()` function
// from the "golang.org/x/net/html" package then you can pass this node
// directly to the converter.
func ConvertNode(doc *html.Node, opts ...converter.ConvertOptionFunc) ([]byte, error) {
conv := converter.NewConverter(