mobilizon.chapril.org-mobil.../js/src/filters/utils.ts
Thomas Citharel 4144e9ffd0
Introduce group basic federation, event new page and notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-06-03 16:01:26 +02:00

10 lines
224 B
TypeScript

/**
* New Line to <br>
*
* @param {string} str Input text
* @return {string} Filtered text
*/
export default function nl2br(str: string): string {
return `${str}`.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1<br>");
}