mobilizon/js/src/utils/html.ts

8 lines
230 B
TypeScript
Raw Normal View History

export function nl2br(text: string): string {
return text.replace(/(?:\r\n|\r|\n)/g, "<br>");
2019-04-26 13:22:16 +00:00
}
export function flattenHTMLParagraphs(html: string): string {
return html.replace("</p><p>", "<br />").replace(/<?\/p>/g, "");
}