We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 428b891 + 7b7d6b7 commit beee89cCopy full SHA for beee89c
1 file changed
src/common/components/mock-components/front-text-components/rich-text/rich-text.utils.ts
@@ -1,6 +1,7 @@
1
export const parseTextWithFormatting = (text: string): string => {
2
// Apply <br>
3
- let parsedText = text.replace(/(?:\\n|<br>)/g, '<br>');
+ // 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>');
5
6
// Replace *text* <strong>text</strong>
7
parsedText = parsedText.replace(/\*(.*?)\*/g, '<strong>$1</strong>');
0 commit comments