Skip to content

Logic blocks without # or : #4

@jimafisk

Description

@jimafisk

Svelte's templating language prefixes conditionals like {#if answer === 42} and {:else} which sometimes confuses folks: htmlx-org/HTMLx#12

Removing the # and : was proposed in Svelte at one point when discussing syntax changes (sveltejs/svelte#1318 (comment)), but the core team thought this would making parsing too difficult.

If feasible, it would probably be more familiar for most folks to simply use syntax like {if answer === 42} and {else} and {/if}. The same would go for loops: {each} and {/each}

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