Snappy GitHub-flavored markdown editor with mermaid pan/zoom, code highlight, outline, and per-pane themes. Runs in VS Code Desktop AND vscode.dev / github.dev.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Per-pane light / dark themes (cycle independently)
Resizable splitters; widths cached across sessions via globalState
Tab swap stays snappy — webview state preserved (retainContextWhenHidden)
Build (local)
cd vscode
npm install
npm run build # esbuild dual-target + vite webview
npm run package # produces gh-md-editor-X.Y.Z.vsix
The parent project (../) must already have node_modules populated (npm install once at the top level). The webview Vite build aliases @gmd → ../src so Editor / Preview / Outline / Splitter Svelte components are shared with the web app build.
Install
VS Code → Extensions → ... menu → Install from VSIX... → select gh-md-editor-X.Y.Z.vsix
Open any .md file; it opens in the GH MD Editor by default.
To temporarily use the default text editor: right-click file → Reopen With... → Text Editor.
Full document replacement (Phase 2: structured changes[] for proper undo granularity)
webview → host
widthsChange
{ splitPct, outlineSplitterPct }
Persist splitter widths to globalState
host → webview
externalUpdate
{ text }
External edit (other extension, multi-cursor scenario) — re-dispatch to CM6
Known limitations (Phase 1)
Edit flow uses full-document replace per change; breaks VS Code's per-keystroke undo granularity. Cmd+Z still works but bundles many keystrokes at once.
Mermaid requires 'unsafe-eval' in webview CSP (uses new Function() internally). Phase 2: try securityLevel: 'sandbox' for a cleaner alternative.
vscode.dev / github.dev compat: build produces the web bundle, but end-to-end verification via @vscode/test-web is Phase 2 work.
Private GitHub user-attachment images (the TM-bridge workaround in the web app) are not yet bridged through vscode.authentication. Phase 3.