From 34de1b64f0174cc61b6df8a24becc9bad37fc0bc Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin <14205339+gikari@users.noreply.github.com> Date: Tue, 4 Mar 2025 21:39:58 +0100 Subject: [PATCH] Fix scene preview with nodes, that have spaces in names (#806) Fixes #688 --- src/scene_tools/parser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scene_tools/parser.ts b/src/scene_tools/parser.ts index 6d02651..520d94a 100644 --- a/src/scene_tools/parser.ts +++ b/src/scene_tools/parser.ts @@ -87,9 +87,9 @@ export class SceneParser { const nodeRegex = /\[node.*/g; for (const match of text.matchAll(nodeRegex)) { const line = match[0]; - const name = line.match(/name="([\w]+)"/)?.[1]; + const name = line.match(/name="([^.:@/"%]+)"/)?.[1]; const type = line.match(/type="([\w]+)"/)?.[1] ?? "PackedScene"; - let parent = line.match(/parent="([\w\/.]+)"/)?.[1]; + let parent = line.match(/parent="(([^.:@/"%]|[\/.])+)"/)?.[1]; const instance = line.match(/instance=ExtResource\(\s*"?([\w]+)"?\s*\)/)?.[1]; // leaving this in case we have a reason to use these node paths in the future