Use our free Advanced On-Page SEO Checker to handle your tasks efficiently in the browser.
\n`;
}// Set Code
document.getElementById('finalCode').value = md;// Render Live Preview (HTML Conversion)
// Clean regex replacements for live view
let html = md
.replace(/\n/g, '
')
.replace(/# (.*?)
/g, '
$1
')
.replace(/### (.*?)
/g, '
$1
')
.replace(/!\[(.*?)\]\((.*?)\)/g, '

') // Images
.replace(/\[(.*?)\]\((.*?)\)/g, '
$1') // Links
.replace(/- (.*?)
/g, '
$1') // Lists
.replace(/---/g, '
');document.getElementById('renderArea').innerHTML = html;
}function switchTab(tab) {
document.querySelectorAll('.tab-content').forEach(e => e.style.display = 'none');
document.querySelectorAll('.preview-tabs button').forEach(b => b.classList.remove('active'));
if(tab === 'preview') {
document.getElementById('viewPreview').style.display = 'block';
document.querySelector('.preview-tabs button:first-child').classList.add('active');
} else {
document.getElementById('viewCode').style.display = 'block';
document.querySelector('.preview-tabs button:last-child').classList.add('active');
}
}function copyCode() {
document.getElementById('finalCode').select();
document.execCommand('copy');
alert("Markdown copied!");
}function downloadCode() {
const text = document.getElementById('finalCode').value;
const blob = new Blob([text], {type: "text/markdown"});
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = "README.md";
a.click();
}window.onload = init;
How to use this tool
This tool runs client-side for maximum speed and privacy. No data is sent to our servers.