1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Allow center

This commit is contained in:
Zack Scholl 2018-02-18 12:04:23 -08:00
parent c1a78c2006
commit 4ebf9e02ef
2 changed files with 2 additions and 1 deletions

View File

@ -295,7 +295,7 @@ func handlePageRequest(c *gin.Context) {
// Destroy page if it is opened and primed // Destroy page if it is opened and primed
if p.IsPrimedForSelfDestruct && !p.IsLocked && !p.IsEncrypted { if p.IsPrimedForSelfDestruct && !p.IsLocked && !p.IsEncrypted {
p.Update("*This page has self-destructed. You cannot return to it.*\n\n" + p.Text.GetCurrent()) p.Update("<center><em>This page has self-destructed. You cannot return to it.</em></center>\n\n" + p.Text.GetCurrent())
p.Erase() p.Erase()
if p.IsPublished { if p.IsPublished {
command = "/read" command = "/read"

View File

@ -182,6 +182,7 @@ func MarkdownToHtml(s string) string {
pClean := bluemonday.UGCPolicy() pClean := bluemonday.UGCPolicy()
pClean.AllowElements("img") pClean.AllowElements("img")
pClean.AllowElements("center")
pClean.AllowAttrs("alt").OnElements("img") pClean.AllowAttrs("alt").OnElements("img")
pClean.AllowAttrs("src").OnElements("img") pClean.AllowAttrs("src").OnElements("img")
pClean.AllowAttrs("class").OnElements("a") pClean.AllowAttrs("class").OnElements("a")