diff --git a/documentation/docs/02-template-syntax/02-basic-markup.md b/documentation/docs/02-template-syntax/02-basic-markup.md index a80b7ca995..43a064b4e2 100644 --- a/documentation/docs/02-template-syntax/02-basic-markup.md +++ b/documentation/docs/02-template-syntax/02-basic-markup.md @@ -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 +

{ in curly braces { { in curly braces } or { in curly braces }

+

{ it also works only escaping the start curly brace }

+``` + +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:
{/^[A-Za-z ]+$/.test(value) ? x : y}
``` -> Curly braces can be included in the HTML by using their [HTML entity](https://developer.mozilla.org/docs/Glossary/Entity) strings. - -```svelte -

{ in curly braces { { in curly braces } or { in curly braces }

-

{ it also works only escaping the start curly brace }

-``` - ## Comments You can use HTML comments inside components.