# Hashmark: Markdown, perfected for the Mac Website: https://hashmarkmd.com/ Source: https://github.com/hashmark-app/hashmark (MIT license) Support: todd@shipyard.media This file is a plain-text version of the Hashmark website, followed by key sections of the project README (copied from https://github.com/hashmark-app/hashmark/blob/main/README.md). --- ## The website Hashmark. Markdown, perfected for the Mac. Write, read and preview Markdown in a fast, native Mac app. Free, private and open source. App Store name: "Hashmark: Markdown Editor". Status: coming soon to the Mac App Store. Available now on GitHub. Free. No ads, no account, no tracking. Requires macOS 14 or later. Universal app. ### Why Hashmark: everything you want, nothing you don't - Instant (145 ms): documents open to a rendered preview in 145 ms while Hashmark is running. A cold launch shows your document in under 400 ms. - Tiny (12 MB): about 12 MB installed and 6 MB zipped. Built with AppKit and the WebKit already on the Mac. No bundled browser. - Free, and private: no ads, no account, no subscription and no tracking. Nothing touches the network unless you ask. - Open source (MIT): every line of Hashmark is public on GitHub. Read it, build it yourself, report a bug or make it better. ### Live reload: made for files that change while you watch When vim, VS Code, git or an AI agent writes to your document, Hashmark updates in about 50 ms (Release build; every reload must take under 150 ms). The cursor and scroll position stay put, and the changed lines glow briefly, then fade. Unsaved edits are never overwritten silently. ### Rendering: every kind of Markdown GitHub Flavored Markdown with tables, task lists, footnotes, alerts and emoji. Syntax-highlighted code in about 40 languages, LaTeX math and Mermaid diagrams. Smart quotes, dashes and hanging punctuation, never inside code. The same renderer powers Finder thumbnails and Quick Look (press Space in Finder). ### Features - Live mode (⌘4): formatting appears as you type; Markdown syntax stays hidden except on the line being edited. - Four views: Editor, Split with scroll sync, Preview and Live (⌘1 to ⌘4). - Clickable checkboxes: tick a task in the preview and the source updates, with undo. - Tables you can edit: click a cell in the preview, type, press Tab; the source table stays aligned. - Smart paste: screenshots are saved next to the document; web pages, Notes and spreadsheets paste as clean Markdown. - Outline sidebar: jump to any heading or drag one to move its whole section; browse and search a folder of files. - Open Quickly (⇧⌘O): find files by name or content. Command palette (⇧⌘P) lists every command. - Quick Look: press Space on a .md file in Finder to see it rendered; Finder thumbnails show the page. - Focus & typewriter: dim everything but the current paragraph, or keep the current line centered. - Never lose a word: autosave, Browse All Versions, Revert and Duplicate. - Print & export: print with proper typography, or export as PDF or HTML. - Made for keyboards: Vim key bindings, a Format menu and shortcuts; word count, reading time and goals. ### Privacy & security: opens untrusted files safely A README from the internet can't run code, track you or phone home. Every document is re-parsed and rebuilt from an allowlist of tags; JavaScript is turned off for page content and a strict Content Security Policy blocks it again; remote images load only when you turn them on, with no cookies and no referrer. Planned App Store privacy label: Data Not Collected. ### Speed: fast, measurably Every release must pass Hashmark's own open-time scripts: a warm open under 200 ms and a cold launch under 500 ms. Latest results (medians of three runs of scripts/measure-large.sh, Release build, M2 Mac14,15, macOS 27.2.1, measured 2026-11-30; https://github.com/hashmark-app/hashmark/blob/main/docs/benchmarks.md): - Window on screen: 140 ms (warm open, 10 KB document) - Rendered preview: 145 ms (warm open, 10 KB document) - Preview of a 10 MB file: 197 ms (warm open, first screen) - Cold launch: 374 ms (launch to a visible document, 10 KB document) - On disk: 12.1 MB (universal app, command-line tool included) - Zipped: 6.3 MB ### Command line In Hashmark, choose Hashmark ▸ Install Command Line Tool…, then: hashmark README.md hashmark . git config --global core.editor "hashmark --wait" hashmark cat CHANGELOG.md ### Open source Hashmark is MIT licensed and built in the open. Copyright 2026 Todd Williams. Questions or feedback: todd@shipyard.media. Issues: https://github.com/hashmark-app/hashmark/issues --- ## From the README ### Features (README) **Views** - **Editor** (⌘1), **Split** (⌘2, the preview scrolls with the editor), **Preview** (⌘3) and **Live** (⌘4). Live is a single pane where formatting appears as you type: Markdown syntax is hidden except on the line you're editing, and checkboxes, bullets, rules, quote bars and local images are drawn inline. Clicking a checkbox toggles it. - **Sidebar** (⌃⌘S). The **Outline** tab lists the document's headings: click one to jump to it, drag one to move its whole section, or type to filter. The **Files** tab lists the Markdown files in the document's folder, and its search field searches the names and the text of every file. **File ▸ Open Folder…** (⌥⌘O) opens a folder's README and shows its files. - **Open Quickly** (⇧⌘O) finds files by name and searches their contents. Opening a text match jumps to that line. - **Command palette** (⇧⌘P) lists every command available right now, with its shortcut. - **Status bar** shows the word count and reading time (and progress toward a word goal, set with *View ▸ Set Word Goal…*), Saved or Edited, the cursor position, and the Vim mode. - **Focus mode** (⇧⌘F) dims everything except the current paragraph. **Typewriter scrolling** (⇧⌘T) keeps the current line centered. - **Preview themes** (*View ▸ Preview Theme*): GitHub, Academic, Typewriter and Solarized, plus your own `.css` files in the Themes folder. **Markdown** - GitHub Flavored Markdown via cmark-gfm: tables, task lists, strikethrough, autolinks, footnotes, heading anchors, and GitHub **alerts** (`> [!NOTE]`, `> [!TIP]`, `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`), **emoji shortcodes** (`:rocket:`), and YAML **front matter** shown as a table. - **Syntax-highlighted code** (highlight.js, about 40 languages), **math** (`$…$`, `$$…$$` and ` ```math ` blocks, via KaTeX and drawn natively as MathML), and **Mermaid diagrams** (` ```mermaid `). - Smart typography in the preview: curly quotes, dashes, ellipses and hanging punctuation, never inside code. - **Clickable task lists**: checkboxes in the preview toggle `[ ]` and `[x]` in the source, with undo. - **Tables you can edit in the preview**: click a cell, type, then press Tab or Shift-Tab to move between cells (Tab on the last cell adds a row), Return to finish, or Escape to cancel. The source table is re-aligned, and undo works. - **Video**: local files (`![](videos/clip.mov)`) always play. Public URLs play when *View ▸ Load Remote Images & Video* is on. Video never autoplays. **Writing** - Syntax highlighting, find and replace (⌘F, ⌥⌘F), list continuation, a Format menu, and Vim key bindings (⌃⌘V). - **Smart paste**: - A screenshot is saved as `images/image-….png` next to the document. - Image and video files from Finder are copied into `images/` or `videos/`. - A URL pasted onto selected text becomes a link. - A spreadsheet range becomes a table. - Rich text from a web page, Notes, TextEdit or Pages becomes clean Markdown. ⌥⇧⌘V always pastes plain text. - **Drop** images, videos or CSV files onto the editor or the preview to get image tags or tables. Drop `.md` files onto the editor to get relative links. **Documents and the system** - **Live reload**: when another app changes the file (vim, VS Code, git, an AI agent appending to it), the editor and preview update within about 50 ms in Release builds (the budget is 150 ms). The cursor, selection and the text at the top of the view stay put, and the changed blocks glow briefly and fade (no animation with Reduce Motion). This covers in-place writes, appends, atomic saves (write a temporary file, then rename it over the document) and delete + recreate. If you have unsaved edits, a sheet asks whether to keep your version or use the one on disk (undoable). Nothing is overwritten silently. - NSDocument behavior: autosave, **Browse All Versions…** (a timeline of earlier versions), Revert, Duplicate, Rename, Open Recent and tabs. - **Print** (⌘P), **Export as PDF** (⇧⌘E) and **Export as HTML**. - **Quick Look**: press Space on a `.md` file in Finder to see it rendered. Finder thumbnails show the start of the page. - **Feedback, on your terms.** *Help ▸ Send Feedback…* (also linked from the About window) opens a pre-filled email to the support address. *Help ▸ Report a Problem…* offers that email, or a new GitHub issue, and attaches the most recent Hashmark crash report only if you tick the box. *Help ▸ Hashmark on GitHub* opens the repository. A report includes only the app version, macOS version and Mac model, never document content, and nothing is ever sent automatically. The support address and repository URL are single constants in `Hashmark/App/Support.swift`. - On first launch, the app asks once whether it should open `.md` files. It asks for an App Store review only after it has been used on 10 different days. - Fast: in the running app, a document's window is on screen in about 130 ms and its rendered preview in about 175 ms. `scripts/measure-open.sh` checks this and fails above 200 ms. ### Command line (README) Hashmark ▸ Install Command Line Tool… adds `/usr/local/bin/hashmark` (a link to the tool inside the app; macOS asks for an administrator password). Hashmark ▸ Uninstall Command Line Tool… removes it. ```sh hashmark README.md # open a file (or several) hashmark . # open a folder: its README, with the Files sidebar git config --global core.editor "hashmark --wait" # --wait returns when the window closes curl -s https://example.com/notes.md | hashmark # piped input opens as a new document hashmark cat CHANGELOG.md # print it rendered for the terminal (plain when piped # or with NO_COLOR; --color, --width N, # --front-matter to show YAML front matter) ``` ### Security model for rendered HTML Markdown can contain raw HTML, so the preview treats every document as hostile. The layers below are independent, and each one alone blocks script execution: 1. **Allowlist sanitizer** (`HTMLSanitizer`). cmark's output is re-parsed with an HTML5 parser (SwiftSoup), and a new document is serialized from an allowlist of tags and attributes, with all text and attribute values re-escaped. - Always removed: scripts, event handlers, `style`, forms, iframes, objects, SVG, `meta`, `base`, `link`, `srcset`, `ping`, and URLs other than `http`, `https`, `mailto` or relative. - Code highlighting output is only accepted if it is exactly `` and escaped text. - Math is rebuilt from a MathML allowlist, with KaTeX run with `trust: false` and a macro-expansion limit. 2. **JavaScript is disabled** for page content (`allowsContentJavaScript = false`). The app's own small bridge script (checkboxes, table cells, scroll sync) runs in an isolated `WKContentWorld` that document content can't reach. highlight.js and KaTeX run in a separate JavaScriptCore context with no DOM and no network. 3. **Strict Content-Security-Policy**, sent both as a response header and as a `` tag: no scripts, frames, objects, forms, connections or fonts. 4. **No network by default.** Remote images and video load only when you turn on *View ▸ Load Remote Images & Video*. Even then, no Referer is sent, there are no cookies (non-persistent data store), and DNS prefetch is off. 5. **Diagrams are inert.** Mermaid runs with `securityLevel: "strict"` in a hidden web view that also has page JavaScript disabled (Mermaid runs in its own content world), no network, and no navigation. Its SVG is shown only as an `` data URL, where SVG can't run script, load anything, or affect the page around it. 6. **No navigation.** The preview never navigates. Clicked web links open in your browser, `.md` links open in Hashmark, and other local files are only revealed in Finder. 7. **Restricted file access.** Local images and video go through a private `md-preview:` URL scheme handler. It serves only regular image and video files, checked after resolving symlinks, and streams video in byte ranges. 8. **Resource limits.** Nesting depth is capped before parsing, the sanitizer is iterative (no recursion), rendering runs on a 64 MB-stack background thread, and highlighting and math have size limits. 9. **Quick Look** runs in sandboxed extensions with the same renderer, and its CSP allows only images attached to the preview, so it never touches the network. Every layer is tested on its own against a real WKWebView, with a local HTTP server that detects any outbound request. This includes injecting **unsanitized** HTML to prove that the CSP and the disabled JavaScript hold without the sanitizer.