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

docs/preprocessing.md

Lines changed: 1 addition & 1 deletion
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

src/transformers/pug.ts

Lines changed: 3 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy