// https://stackoverflow.com/a/5002618
export const cleanHtml = (text) => {
	const pre = document.createElement('pre')
	pre.innerHTML = text.replace(/<br\s*\/?>/mg, '\n')
	const strippedText = pre.textContent || pre.innerText || ''
	return strippedText.replace(/\n/mg, '<br>')
}
