Skip to content

Commit 7b7d6b7

Browse files
authored
Merge pull request #762 from Lemoncode/bug/#761-fix-multi-paragraph-in-rich-text-component
#761-regex-modified
2 parents 72cf941 + 6187cb7 commit 7b7d6b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const parseTextWithFormatting = (text: string): string => {
22
// Apply <br>
3-
let parsedText = text.replace(/(?:\\n|<br>)/g, '<br>');
3+
// Replaces line breaks (`\r\n`, `\r`, `\n`, `\\n`, or `<br>`) with `<br>` tags.
4+
let parsedText = text.replace(/(\r\n|\r|\n|\\n|<br>)/g, '<br>');
45

56
// Replace *text* <strong>text</strong>
67
parsedText = parsedText.replace(/\*(.*?)\*/g, '<strong>$1</strong>');

0 commit comments

Comments
 (0)