move curly brace explanation above regex discussion

pull/8560/head
Ben McCann 3 years ago committed by GitHub
parent 24ebf455d6
commit c721fe0530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -109,7 +109,14 @@ An element or component can have multiple spread attributes, interspersed with r
{expression}
```
Text can also contain JavaScript expressions:
Curly braces can be included in the HTML by using their [HTML entity](https://developer.mozilla.org/docs/Glossary/Entity) strings.
```svelte
<p>&#123; in curly braces &#123; &lbrace; in curly braces &rbrace; or &lcub; in curly braces &rcub;</p>
<p>&#123; it also works only escaping the start curly brace }</p>
```
Text can also contain the result of JavaScript expressions.
> 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.
@ -120,13 +127,6 @@ Text can also contain JavaScript expressions:
<div>{/^[A-Za-z ]+$/.test(value) ? x : y}</div>
```
> Curly braces can be included in the HTML by using their [HTML entity](https://developer.mozilla.org/docs/Glossary/Entity) strings.
```svelte
<p>&#123; in curly braces &#123; &lbrace; in curly braces &rbrace; or &lcub; in curly braces &rcub;</p>
<p>&#123; it also works only escaping the start curly brace }</p>
```
## Comments
You can use HTML comments inside components.

Loading…
Cancel
Save