Skip to content

Commit d99f1d5

Browse files
authored
fix #1750 (#1755)
1 parent 34297de commit d99f1d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands/compile.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,12 @@ function updateStorage(content: string[], storage: string[]): string[] {
283283
let contentString = content.join("\n");
284284
contentString = contentString
285285
// update existing Storages
286-
.replaceAll(/\n(\s*storage\s+(\w+)\s*{\s*)([^}]*?)(\s*})/gim, (_match, beforeXML, name, _oldXML, afterXML) => {
287-
const newXML = storageMap.get(name);
286+
.replaceAll(/\n(\s*storage\s+(\w+)\s*{\s*)(.*?)(>\s*})/gis, (_match, beforeXML, name, _oldXML, afterXML) => {
287+
let newXML = storageMap.get(name);
288288
if (newXML === undefined) {
289289
return "";
290290
}
291+
newXML = newXML.slice(0, newXML.length - 1);
291292
storageMap.delete(name);
292293
return "\n" + beforeXML + newXML + afterXML;
293294
});

0 commit comments

Comments
 (0)