nl2br in JavaScript - markhowellsmead/helpers GitHub Wiki

export const nl2br = (string) => {
	return string.replace(/(?:\r\n|\r|\n)/g, '<br>');
};