${output} `; } return output; } function applyInline(text) { let s = esc(text); if (opts.boldItalic) { s = s.replace(/\*([^*]+)\*/g, '$1'); s = s.replace(/_([^_]+)_/g, '$1'); } if (opts.autoLinks) { s = s.replace(/(https?:\/\/[^\s<>&"]+)/g, '$1'); } return s; } function doConvert() { const text = $('#input').value; if (!text.trim()) return; const html = textToHtml(text); $('#output').textContent = html; $('#preview').innerHTML = html; $('#preview-label').textContent = t('previewLabel'); } function loadExample() { $('#input').value = `Welcome to My Website This is a *simple example* of text that will be converted to HTML. You can use _italic text_ and *bold text* to emphasize important points. Key Features - Convert plain text to HTML paragraphs - Auto-detect lists and format them - Link URLs automatically like https://example.com - Support for *bold* and _italic_ markup 1. First numbered item 2. Second numbered item 3. Third numbered item Thank you for trying this tool!`; doConvert(); } function doClear() { $('#input').value = ''; $('#output').textContent = ''; $('#preview').innerHTML = ''; $('#preview-label').textContent = ''; } $('#toolbar').innerHTML = ` `; GZ.renderToolPage({ category: 'text', titleKey: 'toolTitle', descKey: 'toolDesc', howToSteps: ['step1','step2','step3','step4'], related: [ {icon:'🧹', href:'/text/remove-html-tags.html', name:'Remove HTML Tags'}, {icon:'📄', href:'/text/markdown-to-html.html', name:'Markdown to HTML'}, {icon:'📑', href:'/text/html-to-markdown.html', name:'HTML to Markdown'}, {icon:'💻', href:'/text/html-playground.html', name:'HTML Playground'}, ] });