feat: Enhance text cleanup in LoraLoader, LoraStacker, and WanVideoLoraSelect to handle extra commas and trailing commas

This commit is contained in:
Will Miao
2025-08-16 08:31:04 +08:00
parent 6a281cf3ee
commit 83d1828905
4 changed files with 9 additions and 695 deletions

View File

@@ -145,8 +145,9 @@ app.registerExtension({
}
);
// Clean up multiple spaces and trim
newText = newText.replace(/\s+/g, " ").trim();
// Clean up multiple spaces, extra commas, and trim; remove trailing comma if it's the only content
newText = newText.replace(/\s+/g, " ").replace(/,\s*,+/g, ",").trim();
if (newText === ",") newText = "";
inputWidget.value = newText;
} finally {