\n' + text.split('\n\n').map(s => { const lines = s.split('\n'); const first = lines[0]; const rest = lines.slice(1).join('\n'); if (/^\d+\./.test(first)) return '

    ' + first + '

    ' + rest.replace(/\n/g, '
    ') + '

    '; if (first === first.toUpperCase() && first.length > 5) return '

    ' + first + '

    ' + rest.replace(/\n/g, '
    ') + '

    '; return '

    ' + s.replace(/\n/g, '
    ') + '

    '; }).join('\n') + '\n \n'; const blob = new Blob([html], {type: 'text/html'}); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'cookie-policy.html'; a.click(); URL.revokeObjectURL(a.href); } $('#toolbar').innerHTML = ` `; ['companyName','websiteUrl','contactEmail','country','effectiveDate'].forEach(id => { $('#' + id).addEventListener('input', generate); $('#' + id).addEventListener('change', generate); }); ['chkPreferences','chkStatistics','chkMarketing','chkThirdParty'].forEach(id => { $('#' + id).addEventListener('change', generate); }); // Auto-generate on load generate(); GZ.renderToolPage({ category: 'text', titleKey: 'toolTitle', descKey: 'toolDesc', howToSteps: ['step1','step2','step3','step4'], related: [ {icon:'🔒', href:'/text/privacy-policy-generator.html', name:'Privacy Policy'}, {icon:'📋', href:'/text/terms-of-service-generator.html', name:'Terms of Service'}, {icon:'⚖️', href:'/text/disclaimer-generator.html', name:'Disclaimer'}, {icon:'🤖', href:'/seo/robots-txt-generator.html', name:'Robots.txt'}, ] });