terraform-provider-gitea/vendor/github.com/hashicorp/terraform-plugin-docs/internal/mdplain/mdplain.go

13 lines
321 B
Go
Raw Normal View History

2022-04-03 04:07:16 +00:00
package mdplain
import "github.com/russross/blackfriday"
// Clean runs a VERY naive cleanup of markdown text to make it more palatable as plain text.
func PlainMarkdown(md string) (string, error) {
pt := &Text{}
html := blackfriday.MarkdownOptions([]byte(md), pt, blackfriday.Options{})
return string(html), nil
}