From ad6ac50dc9de7995d792468a3028267ae133f1cb Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 22 Aug 2025 23:16:57 +0200 Subject: [PATCH] method convertNewlinesToParagraphs added. see #482 --- js/mzta-utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 772aa8a2..5596eaa2 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -239,6 +239,14 @@ function convertBrToNewlines(html) { return html.replace(//gi, '\n'); } +export function convertNewlinesToParagraphs(input) { + return input + .split('\n') + .map(line => `

${line}

`) + .join(''); +} + + // 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) {