8000 Do not render section when its name is not found in any context by grego · Pull Request #34 · maciejhirsz/ramhorns · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Do not render section when its name is not found in any context #34

New issue

Have 8000 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

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

grego
Copy link
Contributor
@grego grego commented Sep 7, 2020

Per mustache specification, when the name of a variable is not found in any context, it is not rendered.
This PR makes this behaviour consistent for sections.

Note the same is not done for inverses. Personally, I think as far as it is possible, the desired behaviour should be to always have exactly one of section or its inverse rendered.

@grego
Copy link
Contributor Author
grego commented Sep 18, 2020

I've created another commit, which kind of makes this behaviour consistent for inverses.
Before, when an inverse used a name not present in any context, it would render, but cleared up to the last bit, so no variables could be used. I think it's desirable to still be left at least without the original context.

@maciejhirsz maciejhirsz merged commit 6c4c854 into maciejhirsz:master Oct 8, 2020
@maciejhirsz
Copy link
Owner

Cheers, published 0.10

@grego grego deleted the section_not_found branch October 11, 2020 16:28
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

Successfully merging this pull request may close these issues.

2 participants
0