From 86a457c01c64bd1f0de1c02168a0ad114728ad3f Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 22 Aug 2025 23:02:26 +0200 Subject: [PATCH] converting newlines to
when sending the prompt to the api chat, to preserve the breaklines in the chat. To the AI is sent without
. see #469 --- api_webchat/controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_webchat/controller.js b/api_webchat/controller.js index 18fa2277..7434816e 100644 --- a/api_webchat/controller.js +++ b/api_webchat/controller.js @@ -21,7 +21,7 @@ */ import { placeholdersUtils } from '../js/mzta-placeholders.js'; -import { getAPIsInitMessageString } from '../js/mzta-utils.js'; +import { getAPIsInitMessageString, convertNewlinesToBr } from '../js/mzta-utils.js'; // Get the LLM to be used const urlParams = new URLSearchParams(window.location.search); @@ -204,6 +204,6 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => { }); function sendPrompt(message){ - messageInput._setMessageInputValue(message.prompt); + messageInput._setMessageInputValue(convertNewlinesToBr(message.prompt)); messageInput._handleNewChatMessage(); } \ No newline at end of file