From fc37d5e09335194d0519f42935bf3542c9dabf50 Mon Sep 17 00:00:00 2001 From: "henry.chen" Date: Wed, 29 Nov 2017 16:17:58 +0800 Subject: [PATCH] fix page:admin/write-post autocomplete tag --- back.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/back.go b/back.go index 31798d6..c1eadee 100644 --- a/back.go +++ b/back.go @@ -3,6 +3,7 @@ package main import ( "bytes" + "encoding/json" "fmt" "html/template" "net/http" @@ -118,7 +119,8 @@ func HandlePost(c *gin.Context) { for tag, _ := range Ei.Tags { tags = append(tags, T{tag, tag}) } - h["Tags"] = tags + str, _ := json.Marshal(tags) + h["Tags"] = string(str) c.Status(http.StatusOK) RenderHTMLBack(c, "admin-post", h) }