Post is working now

This commit is contained in:
2023-11-20 21:58:11 +01:00
parent 201579ad87
commit 477db1afa0
2 changed files with 12 additions and 9 deletions

View File

@@ -27,14 +27,6 @@ func (p *Post) HTMLPage() string {
var content string
if p.GemtextContent.Valid {
content = p.GemtextContent.String
if strings.HasPrefix(content, "{") {
content = strings.TrimPrefix(content, "{")
}
if strings.HasSuffix(content, "true}") {
content = strings.TrimSuffix(content, "true}")
}
} else {
content = ""
}
lines := strings.Split(content, "\n")
@@ -61,6 +53,7 @@ func (p *Post) HTMLPage() string {
url := parts[0]
htmlLines = append(htmlLines, fmt.Sprintf(`<a href="%s.html">%s</a>`, url, url))
}
} else {
htmlLines = append(htmlLines, "<p>"+line+"</p>")
}