diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-29 14:51:51 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-29 23:22:41 +0200 |
commit | 329e88db1f6d043d32c7083570773dccfd4f11fc (patch) | |
tree | a4bab342aa28523be8c854ceb88fece17f634410 /parser/pageparser/pageparser.go | |
parent | e073f4efb1345f6408000ef3f389873f8cf7179e (diff) | |
download | hugo-329e88db1f6d043d32c7083570773dccfd4f11fc.tar.gz hugo-329e88db1f6d043d32c7083570773dccfd4f11fc.zip |
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
Diffstat (limited to 'parser/pageparser/pageparser.go')
-rw-r--r-- | parser/pageparser/pageparser.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/parser/pageparser/pageparser.go b/parser/pageparser/pageparser.go index db563d44c..acdb09587 100644 --- a/parser/pageparser/pageparser.go +++ b/parser/pageparser/pageparser.go @@ -80,7 +80,7 @@ func (t *Iterator) Input() []byte { return t.l.Input() } -var errIndexOutOfBounds = Item{tError, 0, []byte("no more tokens")} +var errIndexOutOfBounds = Item{tError, 0, []byte("no more tokens"), true} // Current will repeatably return the current item. func (t *Iterator) Current() Item { |