Markdown editor / preview
A self-contained, editable markdown preview page: open it anywhere, offline, nothing leaves your device.
Runs on your device. The file is never uploaded.
Markdown editor / preview wraps a markdown file in one HTML page, your source in a textarea on the left and the rendering on the right, named with -preview.html. The renderer rides inside that page, and a javascript, data or vbscript URL is rewritten to a hash. It covers headings, lists, code and emphasis, not tables or footnotes.
Questions
What do I get back?
A single self-contained HTML file, named after your input with -preview added. Open it in any browser and you get an editor: your markdown seeded into a textarea on the left, rendered live on the right as you type. The renderer is embedded in the file, so it works offline, on another machine, with no dependencies and no network access.
Which markdown syntax does the preview support?
The common subset. Headings from one to six hashes, horizontal rules, blockquotes, unordered lists with a hyphen or an asterisk, ordered lists with a number and a full stop, fenced code blocks, inline code, bold, italic, links and images. Tables, nested lists, reference-style links, setext headings, footnotes and HTML passthrough are not implemented.
How is this different from Markdown to HTML?
That one converts, this one is an editor. Markdown to HTML runs pandoc and produces a spec-complete conversion of your document, which is what you want for publishing. This produces a live editing page whose renderer is a small hand-written one covering the common cases. Use this to review and tweak markdown, and that one to convert it properly.
Is the generated page safe to open?
It is built to be. Your markdown is escaped before it is placed in the textarea, so it cannot break out and become markup. In the renderer, ampersands and angle brackets are escaped in all content, quotes are escaped inside link and image attributes, and any URL with a javascript, data or vbscript scheme is replaced with a plain hash so it cannot execute.
Does the page phone home when I open it?
No. Everything, including the renderer, is inside the one HTML file. There are no script tags pointing at a CDN, no fonts to fetch and no analytics, so it works with the network off and on a machine that has never seen this site. The conversion itself runs in a Web Worker in this tab, so your markdown is never uploaded either.