From 5c0b011dadbfbd52b7d4ff795c6c564a27cb4c4f Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 18 Jun 2025 22:25:37 +0200 Subject: [PATCH] Add convertNewlinesToBr function to replace newlines with
tags --- js/mzta-utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index da7c6b94..9b6714cc 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -199,6 +199,10 @@ export function stripHtmlKeepLines(htmlString) { .trim(); // removes leading/trailing whitespace } +export function convertNewlinesToBr(text) { + return text.replace(/\n/g, '
'); +} + // This method is used to convert the model string id used in the URL // to the model string used in the webpage export function getGPTWebModelString(model) {