summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorAsk Bjørn Hansen <ask@develooper.com>2014-02-20 00:02:08 -0800
committerspf13 <steve.francia@gmail.com>2014-02-20 06:54:56 -0500
commit82fdfa2c722cc89d47ffba8fa3d4bbef48c24c04 (patch)
treec4793a66e7e798f334662d9db2d5b024d9e501d4 /hugolib/shortcode.go
parent5cff3e62198e83957b6163e71fcaf822ccb86c38 (diff)
Warn about bad shortcode parameters (and don't crash)
closes #193
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index cecb1e037..b71fdb427 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -143,6 +143,11 @@ func Tokenize(in string) interface{} {
for i, v := range first {
index := strings.Index(v, "=")
+ if index < 0 {
+ fmt.Printf("Shortcode parameters must be key=value pairs (no spaces) (saw '%s')\n", v)
+ continue
+ }
+
if !inQuote {
if index > 1 {
keys = append(keys, v[:index])