Post is working now
This commit is contained in:
@@ -71,7 +71,7 @@ const editorTemplate = `
|
||||
<input type="text" name="title" placeholder="Naslov" value="{{.Title}}" />
|
||||
<input name="ID" type="hidden" value="{{.ID}}" />
|
||||
<div id="editorcontainer">
|
||||
<textarea id="editor">{{.GemtextContent}}</textarea>
|
||||
<textarea id="editor" name="editor">{{.GemtextContent.String}}</textarea>
|
||||
</div>
|
||||
<input type="submit" value="Sačuvaj" />
|
||||
</form>
|
||||
@@ -85,6 +85,16 @@ const editorTemplate = `
|
||||
`
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user