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

Improve documentation to explain that Inverted Sections uses falsy #420

Closed
Lukenickerson opened this issue Jan 12, 2015 · 2 comments
Closed

Comments

@Lukenickerson
Copy link

The documentation (here and here) explains:

The block of an inverted section is rendered only if the value of that section's tag is null, undefined, false, or an empty list.

they will be rendered if the key doesn't exist, is false, or is an empty list.

But the spec says

If the data is not of a list type, it is coerced into a list as follows: if the data is truthy (e.g. !!data == true), use a single-element list containing the data, otherwise use an empty list.

(From issue #186)

The documentation should be more clear that the inverted section uses falsy. Personally I was confused when a value of 0 was triggering the inverted section (I read the docs thinking "is" is like ===).

@dasilvacontin
Copy link
Collaborator

If no one offers to send a PR, I'll assign this to myself.

@phillipj
Copy link
Collaborator

Fixed with 5f06df2

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