mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
e25a5e1d758021c4c730165b329ae75324c61347
Two related bugs surfaced during end-to-end verification:
1. The 'isAlreadyV5' short-circuit in both the main-side and renderer-side
v4-to-v5 transforms returned the persisted object as-is when a
migration.version=5 marker was present. A previously-shipped v4 build
had written theme: 'ayu-light' (and similar) under the v5 marker;
the transform trusted the marker and passed the invalid theme through,
which then failed the renderer's zod schema on every launch and
reset user settings to defaults.
Fix: in both transforms, when isAlreadyV5 matches, normalize theme
against the v5 enum (light/dark/system) and validate the full result
with the v5 schema before returning. Out-of-range values are replaced
with the v5 default ('system').
2. The renderer's settings-store onRehydrateStorage callback called
useSettingsStore.setState() to reset the store on validation failure.
At that moment the store is still being constructed, and setState
could hit a TDZ ReferenceError (the one we already wrapped in a
try/catch in v5.0.0, which only hid the symptom).
Fix: return the normalized state object from onRehydrateStorage
instead. Zustand's persist middleware applies the returned value
*after* construction completes, so there is no TDZ.
Tests: 334 vitest + 208 jest = 542 passing.
E2E: 12/12 verify-features.mjs steps green; no console errors.
Amit Haridas
MarkdownConverter
A powerful cross-platform Markdown editor and document converter powered by Pandoc, built with Electron. 100% open-source with no proprietary dependencies.
Features
Markdown Editor
PDF Viewer & Editor
- Built-in PDF viewer - Open and view PDF files directly in the app
- Page navigation - Navigate pages with keyboard or buttons
- Zoom controls - Zoom in/out, fit to width, fit to page
- Rotation - Rotate pages left or right
- PDF Editor tools:
- Merge multiple PDFs
- Split PDFs by page range
- Compress PDFs
- Rotate pages
- Delete pages
- Reorder pages
- Add watermarks
- Password protection
- Remove passwords
- Set permissions
Export Options
- PDF - Export to PDF with customizable page sizes and orientation
- DOCX - Standard and Enhanced (template-based) Word export
- ODT - OpenDocument format
- HTML - Web-ready HTML export
- PowerPoint - PPTX presentation export
- EPUB - E-book format
- LaTeX - Academic document format
- RTF - Rich Text Format
Advanced Features
- Custom headers & footers - Add headers/footers to exports with dynamic fields
- Page size configuration - A3, A4, A5, B4, B5, Letter, Legal, Tabloid, or custom sizes
- Batch conversion - Convert entire folders of markdown files
- ASCII Art Generator - Create text banners and diagrams
- Word templates - Use custom Word templates for enhanced exports
- Import documents - Import from 30+ formats (DOCX, PDF, HTML, etc.)
Installation
Prerequisites
Install Dependencies
npm install
Run the Application
npm start
Build for Distribution
# Windows
npm run build:win
# macOS
npm run build:mac
# Linux
npm run build:linux
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| New File | Ctrl+N |
| Open File | Ctrl+O |
| Open PDF | Ctrl+Shift+O |
| Save | Ctrl+S |
| Save As | Ctrl+Shift+S |
| Export | Ctrl+E |
| Ctrl+P | |
| Find | Ctrl+F |
| Undo | Ctrl+Z |
| Redo | Ctrl+Shift+Z |
| New Tab | Ctrl+T |
| Close Tab | Ctrl+W |
| Toggle Preview | Ctrl+Shift+P |
| Zoom In | Ctrl+Shift++ |
| Zoom Out | Ctrl+Shift+- |
Themes
Light Themes
- Atom One Light (Default)
- GitHub Light
- Light
- Solarized Light
- Gruvbox Light
- Ayu Light
- Sepia
- Paper
- Rose Pine Dawn
- Concrete Light
Dark Themes
- Dark
- One Dark
- Dracula
- Nord
- Monokai
- Material
- Gruvbox Dark
- Tokyo Night
- Palenight
- Ayu Dark
- Ayu Mirage
- Oceanic Next
- Cobalt2
- Concrete Dark
- Concrete Warm
PDF Viewer
Open PDF files directly in MarkdownConverter:
- File > Open PDF or Ctrl+Shift+O
- Navigate pages with arrow buttons or page input
- Zoom controls: +/- buttons, Fit Width, Fit Page
- Rotate pages left or right
- Close PDF to return to editor
Distribution & Updates
v5.x uses electron-updater against two feeds:
- GitHub Releases (default, public): the public release at
https://github.com/amitwh/markdown-converter/releases. The CI workflow publisheslatest-{mac,linux,windows}.ymlon every tag. - ConcreteInfo self-hosted (opt-in for enterprise deployments):
https://updates.concreteinfo.co.in/v5/. CI mirrors artifacts on every release whenCONCRETEINFO_DEPLOY_HOOKis set as a repository secret.
Users switch the feed in Settings → Updates → Update channel. Auto-check is enabled by default; disable it in the same panel.
Manual mirror
CONCRETEINFO_DEPLOY_HOOK=... npm run publish:concreteinfo -- 5.1.0
Open Source
MarkdownConverter is 100% open-source. All dependencies are permissively licensed:
- Electron - MIT License
- pdf-lib - MIT License
- pdfjs-dist - Apache 2.0 License
- marked - MIT License
- highlight.js - BSD 3-Clause License
- dompurify - Apache 2.0/MIT License
- docx - MIT License
- xlsx - Apache 2.0 License (SheetJS Community Edition)
License
MIT License - see LICENSE file for details.
Author
Amit Haridas (amit.wh@gmail.com)
Version
v4.1.0
Languages
JavaScript
62.6%
CSS
19.9%
HTML
15.6%
NSIS
0.8%
PowerShell
0.5%
Other
0.6%