                } else if (format === 'markdown') {
                            const viewer = document.getElementById('mindmap-viewer');
                            const currentMindmap = JSON.parse(viewer.dataset.currentMindmap || '{}');
                            if (currentMindmap.markdown) {
                                const blob = new Blob([currentMindmap.markdown], {type: 'text/markdown'});
                                const url = URL.createObjectURL(blob);
                                con