Skip to content

Commit 4845a00

Browse files
committed
Escape quotes and backslashes for string parameters
1 parent b8260b8 commit 4845a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/block_code/ui/blocks/utilities/parameter_input/parameter_input.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func get_string() -> String:
5858
var text: String = get_plain_text()
5959

6060
if block_type == Types.BlockType.STRING:
61-
text = "'%s'" % text
61+
text = "'%s'" % text.replace("\\", "\\\\").replace("'", "\\'")
6262
if block_type == Types.BlockType.VECTOR2:
6363
text = "Vector2(%s)" % text
6464

0 commit comments

Comments
 (0)