From 461a3de983e7c70ea5fc72d1338361bfdbddbb29 Mon Sep 17 00:00:00 2001 From: "Kuang-Chen (KC) Lu" Date: Mon, 13 Apr 2026 16:31:46 -0400 Subject: [PATCH] fix #1750 --- src/commands/compile.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/compile.ts b/src/commands/compile.ts index e7af69e1..56c4e98a 100644 --- a/src/commands/compile.ts +++ b/src/commands/compile.ts @@ -283,11 +283,12 @@ function updateStorage(content: string[], storage: string[]): string[] { let contentString = content.join("\n"); contentString = contentString // update existing Storages - .replaceAll(/\n(\s*storage\s+(\w+)\s*{\s*)([^}]*?)(\s*})/gim, (_match, beforeXML, name, _oldXML, afterXML) => { - const newXML = storageMap.get(name); + .replaceAll(/\n(\s*storage\s+(\w+)\s*{\s*)(.*?)(>\s*})/gis, (_match, beforeXML, name, _oldXML, afterXML) => { + let newXML = storageMap.get(name); if (newXML === undefined) { return ""; } + newXML = newXML.slice(0, newXML.length - 1); storageMap.delete(name); return "\n" + beforeXML + newXML + afterXML; });