package libs import ( "html/template" "github.com/microcosm-cc/bluemonday" "github.com/russross/blackfriday/v2" ) type MarkdownLib struct { } func (ml *MarkdownLib) Render(s []byte) template.HTML { output := blackfriday.Run(s) _ = output html := bluemonday.UGCPolicy().SanitizeBytes(output) // println(string(html)) kek := template.HTML(html) return kek } // func (ml MarkdownLib) MarkDowner(args ...interface{}) template.HTML { // s := blackfriday.MarkdownCommon([]byte(fmt.Sprintf("%s", args...))) // return template.HTML(s) // }