You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
391 B
Go
16 lines
391 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
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
|
|
}
|