shithub: hugo

Download patch

ref: 82fdfa2c722cc89d47ffba8fa3d4bbef48c24c04
parent: 5cff3e62198e83957b6163e71fcaf822ccb86c38
author: Ask Bjørn Hansen <[email protected]>
date: Wed Feb 19 19:02:08 EST 2014

Warn about bad shortcode parameters (and don't crash)

closes #193

--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -143,6 +143,11 @@
 	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])