package cethttp
import (
"html/template"
"strings"
"github.com/senaduka/cetvorke/database"
)
const editorTemplate = `
IslamBosna
`
func editorHtml5Page(post *database.Post) string {
if post.GemtextContent.Valid {
if strings.HasPrefix(post.GemtextContent.String, "{") {
post.GemtextContent.String = strings.TrimPrefix(post.GemtextContent.String, "{")
}
if strings.HasSuffix(post.GemtextContent.String, "true}") {
post.GemtextContent.String = strings.TrimSuffix(post.GemtextContent.String, "true}")
}
} else {
post.GemtextContent.String = ""
}
t1 := template.New("editorHtml5Page")
t1, _ = t1.Parse(editorTemplate)
result := new(strings.Builder)
t1.Execute(result, post)
return result.String()
}