Skip to content

Commit fa6798a

Browse files
ematipicodyc3
andauthored
feat(html/svelte): if/else syntax (#8031)
Co-authored-by: dyc3 <[email protected]>
1 parent ac3fc64 commit fa6798a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3082
-210
lines changed

.changeset/spicy-actors-leave.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Added support for the Svelte syntax `{#if}{/if}`. The Biome HTML parser is now able to parse and format the [`{#if}{/if} blocks`](https://svelte.dev/docs/svelte/if):
6+
7+
```diff
8+
<!-- if / else-if / else -->
9+
{#if porridge.temperature > 100}
10+
-<p>too hot!</p>
11+
+ <p>too hot!</p>
12+
{:else if 80 > porridge.temperature}
13+
-<p>too cold!</p>
14+
+ <p>too cold!</p>
15+
{:else if 100 > porridge.temperature}
16+
-<p>too too cold!</p>
17+
+ <p>too too cold!</p>
18+
{:else}
19+
-<p>just right!</p>
20+
+ <p>just right!</p>
21+
{/if}
22+
```

crates/biome_html_factory/src/generated/node_factory.rs

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/biome_html_factory/src/generated/syntax_factory.rs

Lines changed: 217 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)