           URL.revokeObjectURL(url);
                } else {
                    alert('Markdown content not available.');
                }
            }

            document
                .getElementById('download-options-popup')
                .style
                .display = 'none';
        } catch (error) {
            console.error('Download error:', error);
            alert(error.message);
        }
    }

    document.addEventListener('DOMContentLoaded', function () {
        const downloadBt