You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -424,6 +424,8 @@ Since `typescript` is not officially supported by `svelte` for its template lang
424
424
425
425
### `pug`
426
426
427
+
#### Template blocks
428
+
427
429
Some of Svelte'stemplate syntax is invalid in `pug`. `svelte-preprocess` provides some pug mixins to represent svelte's `{#...}{/...}` blocks: `+if()`, `+else()`, `+elseif()`, `+each()`, `+await()`, `+then()`, `+catch()`, `+debug()`.
428
430
429
431
```pug
@@ -436,6 +438,14 @@ ul
436
438
span No posts :c
437
439
```
438
440
441
+
#### Element attributes
442
+
443
+
Pug encodes everything inside an element attribute to html entities, so `attr="{foo && bar}"` becomes `attr="foo && bar"`. To prevent this from happening, instead of using the `=` operator use `!=` which won't encode your attribute value:
444
+
445
+
```pug
446
+
button(disabled!="{foo && bar}")
447
+
```
448
+
439
449
## FAQ
440
450
441
451
### My VS Code is displaying a lot of errors on my templates when I try to use `x`...
0 commit comments