Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in Handlebars custom helper behavior from 1.0.beta.6 to 1.0.rc.1 #325

Closed
peterldowns opened this issue Oct 1, 2012 · 2 comments

Comments

@peterldowns
Copy link

Here's some server side JS using version 1.0.rc.1:

> var Handlebars = require('handlebars')
undefined
> Handlebars.VERSION
'1.0.rc.1'
> Handlebars.registerHelper('is_menu_item', function(x){console.log('is_menu_item_helper was run'); return true;});
undefined
> Handlebars.compile("{{#if is_menu_item}} hello {{/if}}")({});
''
> Handlebars.registerHelper('is_menu_item', function(x){console.log('is_menu_item_helper was run'); return 'true';});
undefined
> Handlebars.compile("{{#if is_menu_item}} hello {{/if}}")({});
''

Here's some client side JS using version 1.0.beta.6:

> Handlebars.VERSION
"1.0.beta.6"
> Handlebars.registerHelper('is_menu_item', function(x){console.log('is_menu_item_helper was run'); return true;});
undefined
> Handlebars.compile("{{#if is_menu_item}} hello {{/if}}")({});
is_menu_item_helper was run
" hello "

Which behavior is correct? I saw issue #289 which seems related, but I was relying upon the ability to use {{#if my_helper}} and have my_helper execute.

@zallarak
Copy link

I have the same issue.

@wycats
Copy link
Collaborator

wycats commented Oct 17, 2012

That behavior was an accident in previous versions of Handlebars and was removed :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants