kdown = newMarkdown;
                        history[mindMapIndex].timestamp = new Date().toISOString();
                        localStorage.setItem('mindmap-history', JSON.stringify(history));
                        window.location.href = `/history.html?id=${id}`;
                        return;
                    }
                }

                toggleEditMode(false);
            }
        </script>
    </html>
