mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Updated
This commit is contained in:
6
main.go
6
main.go
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -150,7 +151,10 @@ func main() {
|
||||
|
||||
unsafe := blackfriday.MarkdownCommon([]byte(p.Text))
|
||||
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
||||
c.Data(200, "text/html", html)
|
||||
c.HTML(http.StatusOK, "view.tmpl", gin.H{
|
||||
"Title": title,
|
||||
"Body": template.HTML(html),
|
||||
})
|
||||
|
||||
} else {
|
||||
c.Redirect(302, "/"+title)
|
||||
|
||||
Reference in New Issue
Block a user