converting newlines to <br> when sending the prompt to the api chat, to preserve the breaklines in the chat. To the AI is sent without <br>. see #469

This commit is contained in:
mic 2025-08-22 23:02:26 +02:00
parent ebf9b1a31c
commit 86a457c01c

View file

@ -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();
}