From 13deac2527bd04cf7dd7d1688cf5b547954edf10 Mon Sep 17 00:00:00 2001 From: Cohee Date: Mon, 3 Jul 2023 11:34:15 +0300 Subject: [PATCH] Don't insert a newline on empty WI --- public/scripts/world-info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 83ce26b7b..0e9477ffe 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1015,8 +1015,8 @@ async function checkWorldInfo(chat, maxContext) { } }); - const worldInfoBefore = `${WIBeforeEntries.join("\n")}\n` - const worldInfoAfter = `${WIAfterEntries.join("\n")}\n` + const worldInfoBefore = WIBeforeEntries.length ? `${WIBeforeEntries.join("\n")}\n` : ''; + const worldInfoAfter = WIAfterEntries.length ? `${WIAfterEntries.join("\n")}\n` : ''; if (shouldWIAddPrompt) { const originalAN = context.extensionPrompts[NOTE_MODULE_NAME].value;