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: