package grammaratur import ( htmltomarkdown "github.com/JohannesKaufmann/html-to-markdown/v2" "github.com/gomarkdown/markdown" ) // HTMLToMarkdown is the existing ordinary conversion, used by integrations // which do not understand protected authoring blocks. It can be lossy. func HTMLToMarkdown(source string) (string, error) { return htmltomarkdown.ConvertString(source) } // MarkdownToHTML preserves the existing Markdown dialect and renderer options. // It neither interprets authoring fences nor sanitizes the returned HTML. func MarkdownToHTML(source string) string { return string(markdown.ToHTML([]byte(source), nil, nil)) }