English | 简体中文
A lightweight, single-file Markdown editor with live preview, syntax highlighting, math formulas, and diagram rendering. It runs directly in a modern browser—no installation, dependencies, or server required.
- ✅ English and Simplified Chinese interface with automatic browser-language detection
- ✅ Live Markdown preview
- ✅ Syntax highlighting for multiple programming languages
- ✅ KaTeX math rendering
- ✅ Mermaid diagrams with a dedicated viewer, zoom, pan, and PNG/SVG downloads
- ✅ PDF, PNG, and HTML export
- ✅ Multiple themes and independent light/dark mode
- ✅ Table of contents and synchronized scrolling
- ✅ Local file open/save through the File System Access API
- ✅ Drag-and-drop Markdown files
- ✅ Fully offline edition
Open markdown-editor.html in a browser or use the hosted demo above.
📥 Download markdown-editor.html
Use this edition on an intranet or without an internet connection.
- 📥 Download web-markdown-editor-offline.zip
- Extract the archive anywhere.
- Open
markdown-editor-offline.htmlin a browser. - Start editing—no network connection is required.
See the offline edition guide for details.
The Electron desktop application now lives in web-markdown-editor-desktop. This repository remains focused on the lightweight web and offline HTML editions.
| Edition | File | Description |
|---|---|---|
| Online | markdown-editor.html |
Uses CDN resources and requires a network connection |
| Offline | offline/markdown-editor-offline.html |
Uses local assets and runs without a network connection |
Only the online source file needs to be maintained. Generate the offline edition with:
node build-offline.jsThe build script:
- Reads
markdown-editor.html. - Replaces CDN URLs with local
assets/paths. - Writes
offline/markdown-editor-offline.html.
When adding a CDN dependency, add its mapping to build-offline.js:
- Add
<link>and<script>replacements toreplacementRules. - Add JavaScript URL replacements to
themeUrlMappings.
- Frontend: Vanilla HTML, CSS, and JavaScript
- Markdown: Marked.js
- Syntax highlighting: Highlight.js
- Math: KaTeX
- Diagrams: Mermaid.js
- UI: Bootstrap 5
- Export: html2pdf.js and html2canvas
