Skip to content

{{else}} should render a value rather than be a control-flow keyword. #917

Description

@NullVoxPopuli

One thing I noticed as I am both going through the Svelte tutorial again as well as writing a similar one for Ember / <template>, is that {{else}} is is syntactically incoherent.

Everywhere else, we use {{ identifier }} to render a value except for {{else}}.

For consistency, I think we should fix that.
Svelte uses a "continuation" syntax to denote that a block is continuing.

So for us, that would look like this:

{{#if condition}}

{{:else if otherCondition}}

{{:else}}

{{/if}}

which has 0 ambiguity with value-rendering.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions