Various improvements

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-08-12 16:46:44 +02:00
parent 4f9e0911e7
commit 754e44f0a5
33 changed files with 165 additions and 154 deletions

View File

@@ -1,3 +1,7 @@
export function nl2br(text: string): string {
return text.replace(/(?:\r\n|\r|\n)/g, "<br>");
}
export function flattenHTMLParagraphs(html: string): string {
return html.replace("</p><p>", "<br />").replace(/<?\/p>/g, "");
}