A macOS desktop app that instantly cleans up messy markdown — broken formatting, unicode artifacts, inconsistent whitespace, and mangled lists — so you can paste with confidence.
Copy text from ChatGPT, Notion, Google Docs, or Slack and paste it into Markdown Sanity. The app runs a local sanitization pipeline that strips invisible unicode characters, normalizes heading spacing, re-numbers lists, collapses excess blank lines, and fixes indentation — all without changing your actual content.
For text that needs more than mechanical cleanup (broken line wraps, malformed syntax), there's an optional AI formatting mode that sends your text through a lightweight LLM via OpenRouter, then re-sanitizes the output as a safety net.
The app also has a Clipboard Hygiene mode: enable it, and Markdown Sanity runs in the background (via system tray), silently sanitizing everything you copy. Close the window and it keeps working. This is the feature that makes it more than a paste-and-clean tool — it turns your clipboard into a markdown-aware pipeline.
Key features:
- Instant local sanitization — zero latency, no network calls
- Word-level diff view — see exactly what changed, highlighted inline
- Clipboard Hygiene — background mode auto-cleans anything you copy, system-wide
- AI formatting — optional LLM pass for structural repairs (via OpenRouter)
- System tray — hides to tray when Clipboard Hygiene is active, stays out of your way
- Auto-copy — cleaned output is copied to clipboard automatically
- Tauri v2 — Rust backend, native macOS window, system tray, ~5MB binary
- Rust — clipboard hygiene thread using
arboard, full port of the JS sanitizer for background processing - Vanilla JS + CSS — no framework, no build complexity beyond Vite
- OpenRouter API — optional AI inference via Nvidia Nemotron (free tier) or Gemini Flash Lite
- Vite — dev server and frontend bundler
The app has two parallel sanitization paths:
-
Frontend pipeline (JS) — runs on paste/type in the UI. Sanitizer is a pure function chain: remove unicode artifacts → trim whitespace → normalize headings → fix list indentation → re-number ordered lists → collapse blank lines. Optionally chains into an AI formatting step via OpenRouter, with the local sanitizer re-applied to AI output as a safety net.
-
Backend pipeline (Rust) — powers Clipboard Hygiene mode. A dedicated thread polls the system clipboard every 2 seconds, runs copied text through a Rust port of the same sanitizer, and writes the cleaned result back. Tracks "last written" and "last seen" to avoid infinite loops.
The Tauri shell handles tray icon, window lifecycle (hide-to-tray on close when hygiene is active), and IPC between the two layers.
Prerequisites: Rust, Node.js 18+
npm install
npm run tauri devTo build a release .dmg:
npm run tauri buildEarly MVP. The core sanitization works well for the copy-paste-from-AI-chat use case. Built as a personal tool, now polished enough to ship.