From 5cd4f7750e694b2ce15c477c2994e0fa6a214daa Mon Sep 17 00:00:00 2001 From: Kai Erik Niermann <61298289+KaiErikNiermann@users.noreply.github.com> Date: Mon, 24 Jul 2023 07:02:52 +0200 Subject: [PATCH] docs: add parenthesis back to regex literal example (#9027) * fix: added parenthesis to literal notation example * add prettier-ignore --------- Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> --- documentation/docs/02-template-syntax/02-basic-markup.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/docs/02-template-syntax/02-basic-markup.md b/documentation/docs/02-template-syntax/02-basic-markup.md index 7656a599bebc..281790ac71d2 100644 --- a/documentation/docs/02-template-syntax/02-basic-markup.md +++ b/documentation/docs/02-template-syntax/02-basic-markup.md @@ -113,11 +113,12 @@ Text can also contain 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. + ```svelte

Hello {name}!

{a} + {b} = {a + b}.

-
{/^[A-Za-z ]+$/.test(value) ? x : y}
+
{(/^[A-Za-z ]+$/).test(value) ? x : y}
``` ## Comments