mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-23 12:40:19 +01:00
ISSUE-203
This commit is contained in:
parent
cc401433a6
commit
9148f20aee
1 changed files with 1 additions and 2 deletions
|
@ -133,8 +133,7 @@ func (s *Server) previewHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(contentType, "text/x-markdown") || strings.HasPrefix(contentType, "text/markdown") {
|
if strings.HasPrefix(contentType, "text/x-markdown") || strings.HasPrefix(contentType, "text/markdown") {
|
||||||
escapedData := html.EscapeString(string(data))
|
unsafe := blackfriday.Run(data)
|
||||||
unsafe := blackfriday.Run([]byte(escapedData))
|
|
||||||
output := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
output := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
||||||
content = html_template.HTML(output)
|
content = html_template.HTML(output)
|
||||||
} else if strings.HasPrefix(contentType, "text/plain") {
|
} else if strings.HasPrefix(contentType, "text/plain") {
|
||||||
|
|
Loading…
Reference in a new issue