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

Implement inverse blocks #29

Merged
merged 4 commits into from
Oct 22, 2023
Merged

Implement inverse blocks #29

merged 4 commits into from
Oct 22, 2023

Conversation

thekid
Copy link
Member

@thekid thekid commented Oct 22, 2023

A ^ starting a block is an inverse block. Example:

Long version:
{{#person}}User {{name}}{{/person}}{{^person}}Guest{{/person}}

Shorter version:
{{#person}}User {{name}}{{^}}Guest{{/person}}

This expression yields:

  • "User test" for person=["name" => "test"]
  • "Guest" for person=null

This fixes the MethodNotImplementedException being raised for these expressions.

See https://handlebars-lang.github.io/spec/#prod-InvertedBlockStart

@thekid thekid merged commit 044bf24 into master Oct 22, 2023
18 checks passed
@thekid thekid deleted the feature/inverse-blocks branch October 22, 2023 11:50
@thekid
Copy link
Member Author

thekid commented Oct 22, 2023

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

Successfully merging this pull request may close these issues.

1 participant