📝 Markdown 記事本

'; download(html, (filename.value||'untitled') + '.html', 'text/html'); } function download(content, name, type) { const blob = new Blob([content], { type }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = name; a.click(); URL.revokeObjectURL(a.href); } editor.addEventListener('input', () => { dirty = true; render(); }); render(); // auto-load first const all = getAll(); const first = Object.keys(all)[0]; if (first) { filename.value = first; editor.value = all[first]; render(); }