This commit is contained in:
parent
35849b8a33
commit
52d057f2e3
4
main.go
4
main.go
|
@ -332,7 +332,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
pageText := mp.Get(page).Content
|
pageText := mp.Get(page).Content
|
||||||
|
|
||||||
jsonEditor := pageText[0] == '{'
|
jsonEditor := pageText != "" && pageText[0] == '{'
|
||||||
|
|
||||||
var editor template.HTML
|
var editor template.HTML
|
||||||
if jsonEditor {
|
if jsonEditor {
|
||||||
|
@ -401,7 +401,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonPage := pageText[0] == '{'
|
jsonPage := pageText != "" && pageText[0] == '{'
|
||||||
if jsonPage {
|
if jsonPage {
|
||||||
pageText, err = renderJSON(pageText)
|
pageText, err = renderJSON(pageText)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user