Skip to content

Commit 0551a9b

Browse files
authored
fix: add pug const mixin (#518)
Closes #467
1 parent 91ebfef commit 0551a9b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: docs/preprocessing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Apart from those, the Pug preprocessor accepts:
290290

291291
**Template blocks:**
292292

293-
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()`.
293+
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()`.
294294

295295
```pug
296296
ul

Diff for: src/transformers/pug.ts

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ mixin catch(error)
4444
mixin html(expression)
4545
%_| {@html !{expression}}
4646
47+
mixin const(expression)
48+
%_| {@const !{expression}}
49+
4750
mixin debug(variables)
4851
%_| {@debug !{variables}}`.replace(
4952
/%_/g,

0 commit comments

Comments
 (0)