Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9d49f3d

Browse filesBrowse files
authored
fix: add pug mixins to support svelte-5 syntax (#654)
* support for svelte-5 #snippet and @render * Update preprocessing.md
1 parent 359b1f6 commit 9d49f3d
Copy full SHA for 9d49f3d

File tree

Expand file treeCollapse file tree

2 files changed

+10
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-2
lines changed
Open diff view settings
Collapse file

‎docs/preprocessing.md‎

Copy file name to clipboardExpand all lines: docs/preprocessing.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Apart from those, the Pug preprocessor accepts:
291291

292292
**Template blocks:**
293293

294-
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()`.
294+
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()`.
295295

296296
```pug
297297
ul
Collapse file

‎src/transformers/pug.ts‎

Copy file name to clipboardExpand all lines: src/transformers/pug.ts
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ mixin const(expression)
4747
%_| {@const !{expression}}
4848
4949
mixin debug(variables)
50-
%_| {@debug !{variables}}`.replace(
50+
%_| {@debug !{variables}}
51+
52+
mixin snippet(expression)
53+
%_| {#snippet !{expression}}
54+
%_block
55+
%_| {/snippet}
56+
57+
mixin render(expression)
58+
%_| {@render !{expression}}`.replace(
5159
/%_/g,
5260
indentationType === 'tab' ? '\t' : ' ',
5361
);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.