Skip to content

Commit

Permalink
feat: add new syntax {key} for pug (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Misha Zamkevich authored Oct 5, 2020
1 parent 3405224 commit 707206f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Apart from those, the Pug preprocessor accepts:

**Template blocks:**

Some of Svelte's template syntax is invalid in Pug. `svelte-preprocess` provides some pug mixins to represent svelte's `{#...}{/...}` blocks: `+if()`, `+else()`, `+elseif()`, `+each()`, `+await()`, `+then()`, `+catch()`, `+html()`, `+debug()`.
Some of Svelte's template syntax is invalid in Pug. `svelte-preprocess` provides some pug mixins to represent svelte's `{#...}{/...}` blocks: `+if()`, `+else()`, `+elseif()`, `+each()`, `+key()`, `+await()`, `+then()`, `+catch()`, `+html()`, `+debug()`.

```pug
ul
Expand Down
5 changes: 5 additions & 0 deletions src/transformers/pug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ mixin elseif(condition)
%_| {:else if !{condition}}
%_block
mixin key(expression)
%_| {#key !{expression}}
%_block
%_| {/key}
mixin each(loop)
%_| {#each !{loop}}
%_block
Expand Down

0 comments on commit 707206f

Please sign in to comment.