-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix string not rendered in its block #1309
Conversation
Maybe this helps: https://github.com/wycats/handlebars.js/blob/master/README.markdown#compatibility
Am 14. Februar 2017 07:26:28 MEZ schrieb wahwahid <[email protected]>:
…When we want to check a hash is available or not, and value of hash is
a string we can't get it rendered.
### Example :
**Template**
```html
<p>
I want to say "{{#goodbye}}{{goodbye}}{{/goodbye}}
{{#world}}{{world}}{{/world}}"
</p>
```
**Hash**
```javascript
{goodbye: 'Goodbye', world: 'Complex World'}
```
On v4.0.5 it will render `I want to say " "`
After applying this it will render `I want to say "Goodbye Complex
World"`
You can view, comment on, or merge this pull request online at:
#1309
-- Commit Summary --
* fix string not rendered in its block
-- File Changes --
M lib/handlebars/helpers/block-helper-missing.js (2)
M spec/blocks.js (6)
-- Patch Links --
https://github.com/wycats/handlebars.js/pull/1309.patch
https://github.com/wycats/handlebars.js/pull/1309.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#1309
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
|
Yeah compatibility mode does that, but it recursive lookup has performance cost. |
The default way in Handlebars would be the template
|
My last comment was not completely correct. I think the actual default way in Handlebars would be <p>
I want to say "{{#if goodbye}}{{goodbye}}{{/if}} {{#if world}}{{world}}{{/if}}"
</p> Using properties as a block like |
I'm closing this, because there other ways of achieving your goals and we do not want to introduce new features at the moment. |
Okay i can understand. Maybe you can see this again when possible to introduce new features, because migration from original mustache will be easier than before without reduce any performance on simple template. Thank you. |
You can probably just register a modified blockHelperMissing-helper to overwrite the default one. It is pretty isolated, so this should be possible without needing to change Handlebars itself.
Am 16. Februar 2017 03:42:41 MEZ schrieb wahwahid <[email protected]>:
…Okay i can understand. Maybe you can see this again when possible to
introduce new features, because migration from original mustache will
be easier than before. Thank you.
--
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
#1309 (comment)
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
|
When we want to check a hash is available or not, and value of hash is a string we can't get it rendered.
Example :
Template
Hash
On v4.0.5 it will render
I want to say " "
After applying this it will render
I want to say "Goodbye Complex World"