summaryrefslogtreecommitdiff
path: root/management/editor
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-05 20:46:11 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-05 20:46:11 -0800
commite392a85c60a10e652fa1f028b77441e2e0fe3bfb (patch)
tree09be0d2b9564315cdd30a13b18ad7ba0f59bd9a3 /management/editor
parente2566bd4fa9cb82a84bd768ce03a2413ddab5c58 (diff)
testing fix for strings.Split on empty array
Diffstat (limited to 'management/editor')
-rw-r--r--management/editor/elements.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/management/editor/elements.go b/management/editor/elements.go
index 2506495..9fd9d4e 100644
--- a/management/editor/elements.go
+++ b/management/editor/elements.go
@@ -341,9 +341,10 @@ func Tags(fieldName string, p interface{}, attrs map[string]string) []byte {
// get the saved tags if this is already an existing post
values := valueFromStructField(fieldName, p)
- tags := strings.Split(values, "__ponzu")
-
- fmt.Println(tags, len(tags))
+ var tags []string
+ if strings.Contains(values, "__ponzu") {
+ tags = strings.Split(values, "__ponzu")
+ }
html := `
<div class="col s12 __ponzu-tags ` + name + `">