2020-11-27 19:27:44 +01:00
|
|
|
export function nl2br(text: string): string {
|
2020-02-18 08:57:00 +01:00
|
|
|
return text.replace(/(?:\r\n|\r|\n)/g, "<br>");
|
2019-04-26 15:22:16 +02:00
|
|
|
}
|
2022-08-12 16:46:44 +02:00
|
|
|
|
|
|
|
export function flattenHTMLParagraphs(html: string): string {
|
|
|
|
return html.replace("</p><p>", "<br />").replace(/<?\/p>/g, "");
|
|
|
|
}
|