Skip to content

Commit

Permalink
fix: add pug const mixin (#518)
Browse files Browse the repository at this point in the history
Closes #467
  • Loading branch information
fedorovvvv committed Jun 4, 2022
1 parent 91ebfef commit 0551a9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/preprocessing.md
Expand Up @@ -290,7 +290,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()`, `+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()`, `+const()`, `+debug()`.

```pug
ul
Expand Down
3 changes: 3 additions & 0 deletions src/transformers/pug.ts
Expand Up @@ -44,6 +44,9 @@ mixin catch(error)
mixin html(expression)
%_| {@html !{expression}}
mixin const(expression)
%_| {@const !{expression}}
mixin debug(variables)
%_| {@debug !{variables}}`.replace(
/%_/g,
Expand Down

0 comments on commit 0551a9b

Please sign in to comment.