INNER CODE UNIT · Go

ConvertString

JohannesKaufmann/html-to-markdown · convert.go:15

func ConvertString(htmlInput string, opts ...converter.ConvertOptionFunc) (string, error) {
	conv := converter.NewConverter(
		converter.WithPlugins(
			base.NewBasePlugin(),
			commonmark.NewCommonmarkPlugin(),
		),
	)

	return conv.ConvertString(htmlInput, opts...)
}

// ConvertReader converts the html from the reader to markdown.
//
// Under the hood `html.Parse()` is used to parse the HTML.
func ConvertReader(r io.Reader, opts ...converter.ConvertOptionFunc) ([]byte, error) {
	conv := converter.NewConverter(
		converter.WithPlugins(
			base.NewBasePlugin(),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…