helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

Subtract helper throws errors #323

Open skysteve opened 6 years ago

skysteve commented 6 years ago

As I understand it, by convention in handlebars, if a value doesn't exist the helper/value just just return an empty string. However in the case of the subtract helper if the value doesn't exist, it throws an error.

e.g.

Data

{
    "value": 10
}

template

{{#if thing}}
    {{subtract 20.00 thing}}
{{/if}}

throws an error because thing is undefined. It should return ""