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

closes #193
This commit is contained in:
Ask Bjørn Hansen 2014-02-20 00:02:08 -08:00 committed by spf13
parent 5cff3e6219
commit 82fdfa2c72

View file

@ -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])