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 parser for else chaining of helpers #892

Merged
merged 1 commit into from
Nov 8, 2014
Merged

Implement parser for else chaining of helpers #892

merged 1 commit into from
Nov 8, 2014

Commits on Oct 28, 2014

  1. Implement parser for else chaining of helpers

    Allows users to chain multiple helpers together using their inverse callbacks. I.e.
    
    ```
    {{#if foo}}
    {{else if bar}}
    {{else}}
    {{/if}}
    ```
    
    The control flow here effectively causes the helpers to be nested. The above is actually syntactic sugar for this:
    
    ```
    {{#if foo}}
    {{else}}
      {{#if bar}}
      {{else}}
      {{/if}}
    {{/if}}
    ```
    
    Any helper may be used in this manner, the only requirement is they support normal calls and inverse calls.
    
    Introduces a breaking change in that `{{else foo}}` may no longer be used as a root level operator. Instead `{{^foo}}` must be used.
    
    Fixes #72.
    kpdecker committed Oct 28, 2014
    Configuration menu
    Copy the full SHA
    4282668 View commit details
    Browse the repository at this point in the history