package markdown import ( "io" fences "github.com/stefanfritsch/goldmark-fences" "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" htmlrenderer "github.com/yuin/goldmark/renderer/html" "gitlab.com/tozd/go/errors" ) var markdown = goldmark.New( goldmark.WithRendererOptions( htmlrenderer.WithUnsafe(), ), goldmark.WithExtensions( extension.GFM, extension.Footnote, extension.Typographer, &fences.Extender{}, ), ) func Convert(content []byte, w io.Writer) errors.E { return errors.WithStack(markdown.Convert(content, w)) }