diff --git a/routes.go b/routes.go index c41af4d..9da27d1 100644 --- a/routes.go +++ b/routes.go @@ -77,7 +77,12 @@ func serveStaticFile(c *gin.Context, option string) { func renderMarkdown(c *gin.Context, currentText string, title string) { unsafe := blackfriday.MarkdownCommon([]byte(currentText)) - html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) + pClean := bluemonday.UGCPolicy() + pClean.AllowElements("img") + pClean.AllowAttrs("alt").OnElements("img") + pClean.AllowAttrs("src").OnElements("img") + pClean.AllowDataURIImages() + html := pClean.SanitizeBytes(unsafe) html2 := string(html) r, _ := regexp.Compile("\\$\\$(.*?)\\$\\$") for _, s := range r.FindAllString(html2, -1) { diff --git a/templates/index.tmpl b/templates/index.tmpl index 2a645ba..583c0a0 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -34,7 +34,7 @@ body { margin: 0; background: #fff; - max-width: 700px; + max-width: 800px; margin: 0 auto; }