api: Add go files
I know this is a huge commit, but I can't be bothered to check this in part by part.
This commit is contained in:
10
api/markdown_html.go
Normal file
10
api/markdown_html.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gopkg.in/russross/blackfriday.v1"
|
||||
)
|
||||
|
||||
func markdownToHtml(markdown string) string {
|
||||
unsafe := blackfriday.Markdown([]byte(markdown), renderer, extensions)
|
||||
return string(policy.SanitizeBytes(unsafe))
|
||||
}
|
||||
Reference in New Issue
Block a user