From 6187cb75c785636306434fb026d29113fcc9c363 Mon Sep 17 00:00:00 2001 From: oleojake Date: Mon, 5 May 2025 20:46:07 +0200 Subject: [PATCH] #761-regex-modified --- .../front-text-components/rich-text/rich-text.utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts b/src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts index a144ed66..636c2762 100644 --- a/src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts +++ b/src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts @@ -1,6 +1,7 @@ export const parseTextWithFormatting = (text: string): string => { // Apply
- let parsedText = text.replace(/(?:\\n|
)/g, '
'); + // Replaces line breaks (`\r\n`, `\r`, `\n`, `\\n`, or `
`) with `
` tags. + let parsedText = text.replace(/(\r\n|\r|\n|\\n|
)/g, '
'); // Replace *text* text parsedText = parsedText.replace(/\*(.*?)\*/g, '$1');