export function htmlToText(html: string): string { return html .replace(//gi, '') .replace(//gi, '') .replace(//gi, '\n') .replace(/<\/(p|div|h[1-6]|li|tr)>/gi, '\n') .replace(/<[^>]+>/g, '') .replace(/ /g, ' ') .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') .replace(/'/g, "'") .replace(/\n{3,}/g, '\n\n') .trim() }