diff --git a/js/mzta-chatgpt.js b/js/mzta-chatgpt.js index a6d953b6..259bceb3 100644 --- a/js/mzta-chatgpt.js +++ b/js/mzta-chatgpt.js @@ -502,7 +502,7 @@ async function doProceed(message, customText = ''){ if(_gpt_model != ''){ await checkGPTModel(_gpt_model); } - let final_prompt = message.prompt; + let final_prompt = replaceBrWithNewline(message.prompt); // console.log(">>>>>>>>>>>> doProceed customText: " + customText); // console.log(">>>>>>>>>>>> doProceed final_prompt: " + final_prompt); // console.log(">>>>>>>>>>>> doProceed mztaPhDefVal: " + JSON.stringify(mztaPhDefVal)); @@ -774,6 +774,10 @@ function run(checkTab = null) { } } +function replaceBrWithNewline(input) { + return input.replace(//gi, '\\n'); +} + // In the content script browser.runtime.onMessage.addListener((message, sender, sendResponse) => { //console.log(">>>>>>>>>>>>> content.js onMessage: " + JSON.stringify(message));