Skip to content

Commit 9073241

Browse files
authored
docs: mention escaping of curly braces (#8560)
1 parent b62fc8c commit 9073241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

documentation/docs/02-template-syntax/02-basic-markup.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ An element or component can have multiple spread attributes, interspersed with r
106106
107107
## Text expressions
108108

109+
A JavaScript expression can be included as text by surrounding it with curly braces.
110+
109111
```svelte
110112
{expression}
111113
```
112114

113-
Text can also contain JavaScript expressions:
115+
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 `}`.
114116

115117
> 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.
116118

0 commit comments

Comments
 (0)