docs: mention escaping of curly braces (#8560)

pull/9108/head
Jack Farley 1 year ago committed by GitHub
parent b62fc8c8fd
commit 9073241daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -106,11 +106,13 @@ An element or component can have multiple spread attributes, interspersed with r
## Text expressions
A JavaScript expression can be included as text by surrounding it with curly braces.
```svelte
{expression}
```
Text can also contain JavaScript expressions:
Curly braces can be included in a Svelte template by using their [HTML entity](https://developer.mozilla.org/docs/Glossary/Entity) strings: `{`, `{`, or `{` for `{` and `}`, `}`, or `}` for `}`.
> If you're using a regular expression (`RegExp`) [literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#literal_notation_and_constructor), you'll need to wrap it in parentheses.

Loading…
Cancel
Save