瀏覽代碼

ISSUE-203

tags/v1.1.0
Andrea Spacca 5 年之前
父節點
當前提交
9148f20aee
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. +1
    -2
      server/handlers.go

+ 1
- 2
server/handlers.go 查看文件

@@ -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") {
escapedData := html.EscapeString(string(data))
unsafe := blackfriday.Run([]byte(escapedData))
unsafe := blackfriday.Run(data)
output := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
content = html_template.HTML(output)
} else if strings.HasPrefix(contentType, "text/plain") {


Loading…
取消
儲存