From 094bcca3352487835c2dfc9a392eeb288f9c395b Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Wed, 30 Aug 2023 10:45:31 +0200 Subject: [PATCH] Fix error when using single quotes in UI builder (#1709) --- packages/snaps-simulator/src/features/builder/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/snaps-simulator/src/features/builder/utils.ts b/packages/snaps-simulator/src/features/builder/utils.ts index a719039c48..e1057aff0c 100644 --- a/packages/snaps-simulator/src/features/builder/utils.ts +++ b/packages/snaps-simulator/src/features/builder/utils.ts @@ -89,7 +89,7 @@ function getComponentArgs(component: Component): string { case NodeType.Text: case NodeType.Heading: case NodeType.Copyable: - return `'${component.value}'`; + return `'${component.value.replace(/'/gu, "\\'")}'`; case NodeType.Spinner: case NodeType.Divider: default: