Fix: Problem with \r\n and Blackfriday
This commit is contained in:
parent
edf05b8e7c
commit
e4fafed6fa
@ -26,7 +26,8 @@ func WikiPage(c echo.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Printf("res: %T\n", page)
|
fmt.Printf("res: %T\n", page)
|
||||||
unsafe := blackfriday.Run([]byte(page.Body))
|
body := strings.ReplaceAll(page.Body, "\r\n", "\n")
|
||||||
|
unsafe := blackfriday.Run([]byte(body))
|
||||||
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
||||||
return c.Render(http.StatusOK, "page.html", map[string]interface{}{
|
return c.Render(http.StatusOK, "page.html", map[string]interface{}{
|
||||||
"page": page,
|
"page": page,
|
||||||
|
Loading…
Reference in New Issue
Block a user