Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,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()`, `+key()`, `+await()`, `+then()`, `+catch()`, `+html()`, `+const()`, `+debug()`.
Some of Svelte's template syntax is invalid in Pug. `svelte-preprocess` provides some pug mixins to represent svelte's `{#...}{/...}` and `{@...}` blocks: `+if()`, `+else()`, `+elseif()`, `+each()`, `+key()`, `+await()`, `+then()`, `+catch()`, `+html()`, `+const()`, `+debug()`, `+snippet()`, `+render()`.

```pug
ul
Expand Down
10 changes: 9 additions & 1 deletion src/transformers/pug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ mixin const(expression)
%_| {@const !{expression}}

mixin debug(variables)
%_| {@debug !{variables}}`.replace(
%_| {@debug !{variables}}

mixin snippet(expression)
%_| {#snippet !{expression}}
%_block
%_| {/snippet}

mixin render(expression)
%_| {@render !{expression}}`.replace(
/%_/g,
indentationType === 'tab' ? '\t' : ' ',
);
Expand Down
Loading