chatgpt web interface is now stripping any <br> tag in the response. see #462

This commit is contained in:
mic 2025-08-11 22:04:26 +02:00
parent dda315be57
commit f97acf0ece

View file

@ -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(/<br\\s*\\/?>/gi, '\\n');
}
// In the content script
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
//console.log(">>>>>>>>>>>>> content.js onMessage: " + JSON.stringify(message));