-
Notifications
You must be signed in to change notification settings - Fork 77
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
Subexpressions don't work as expected #56
Comments
Thanks. I'll look tonight or tomorrow. |
I cannot think of a quick solution right now. Looked at it for a couple of hours and I'm drawing a blank. Here is what is happening
|
Out of interest does this work if both helpers are async? Or does that cause even more mess? |
When I change
That's from |
@mgutz Any update on this? |
In the process of moving. Will look at this maybe next week. |
I would like to know if it's even going to be possible to fix this. If not we need to reduce our reliance on async helpers. They're a very useful feature, but if they don't work well together with standard helpers when using subexpressions, then we have a bit of a problem with our API which we will need to resolve some other way. |
This is not an easy thing to do; short of forking handlebars to properly handle async helpers, any other solution would be kludgy at best. I'm leaning towards "wont fix". |
I found this: handlebars-lang/handlebars.js#141 I think if you have an idea of how to implement this inside handlebars that it would gain traction. Ghost is one very clear example of why async helpers aren't just useful but pretty much required. Do you have any thoughts on how to do it? I'd love to hear your thoughts on how it could be done in handlebars and how it might done in a 'kludgy' way here in express-hbs so that we can see how the best way to move forward is, and whose arm Ghost needs to bend to make it happen 👍 |
@mgutz, could you have a look at promised-handlebars) I have written it in the past week and I have working test-cases for nesting async helpers within async block-helpers. Though, it has not been tested on larger examples yet. |
Will do. I might not be able to look at it for at least several days though. |
I think,
|
@mgutz have you had any chance to look at promised-handlebars yet? |
Bump |
This is fixed now with my latest merge. |
This is a follow up on #55 but might not directly be related.
Using sub-expressions like
{{encode (url)}}
(as in https://github.com/halfdan/hbs-weird/) where the url helper returns a URL and encode executes encodeURIComponent the expression is replaced by only the result of the url helper. Using{{encode "http://foo.bar/?baz=muh"}}
on its own seems to work just fine.Example case in https://github.com/halfdan/hbs-weird/
The text was updated successfully, but these errors were encountered: