mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Support typed bool, int and float in shortcode params
This means that you now can do: {{< vidur 9KvBeKu false true 32 3.14 >}} And the boolean and numeric values will be converted to `bool`, `int` and `float64`. If you want these to be strings, they must be quoted: {{< vidur 9KvBeKu "false" "true" "32" "3.14" >}} Fixes #6371
This commit is contained in:
@@ -27,7 +27,7 @@ type lexerTest struct {
|
||||
}
|
||||
|
||||
func nti(tp ItemType, val string) Item {
|
||||
return Item{tp, 0, []byte(val)}
|
||||
return Item{tp, 0, []byte(val), false}
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -119,6 +119,7 @@ func equal(i1, i2 []Item) bool {
|
||||
if i1[k].Type != i2[k].Type {
|
||||
return false
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(i1[k].Val, i2[k].Val) {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user