mdstudio: the Markdown editor that catches what breaks before you publish
You write a post in your favourite Markdown editor. It looks perfect. You paste it into GitHub, dev.to or your content generator site, and it falls apart. The raw HTML is gone. The image points at a file on your laptop. [[wiki-links]] print as literal brackets. The diagram is a block of code. A line break you could see in the editor has vanished.
Your editor wasn’t lying, exactly. It just rendered Markdown its way, not the way your target does.
I built mdstudio to close that gap. It’s a free, open-source Markdown editor built around one promise: write once, render the same everywhere. It also covers the rest of the trip, from first draft to review, collaboration (co-writing) and publishing.
Try it: mdstudio.deityhub.com, no sign-up needed
Source: github.com/Deityhub/mdstudio, MIT licensed
The problem with “it looked fine in the editor”
Markdown isn’t one language. It’s a family of dialects:
- CommonMark is the strict, spec-defined core.
- GitHub Flavored Markdown (GFM) adds tables, task lists, strikethrough and autolinks. GitHub also renders alerts, math and Mermaid.
- Many blogs and docs sites strip or block raw HTML.
- Notes apps add wiki-links,
==highlights==and their own embeds.
Most editors smooth over these differences to make the preview look nice. Some turn single newlines into line breaks, curl your quotes, or render extensions that your target will never see. The preview looks great, and that’s exactly why you don’t notice the problem until it’s live.
mdstudio does the opposite. It renders strictly and tells you where your target will differ, and even offers you a way to specify your own custom portability check rules that would match any platform you use for publication.
A real example: one post, four targets
Here’s a short snippet you might write in a notes app and then want to publish:
> [!TIP]
> See [[Setup notes]] for the ==full== config.

The cost is $x^2$ per request.
In a typical editor, all of that looks fine. Here’s what mdstudio tells you, depending on where it’s going:
- Wiki notes: clean. The wiki-link, the highlight, the alert and the math all render, because notes apps support them. The only warning is the local image path, which won’t load once the file leaves your machine.
- GFM extended (GitHub): the alert and the math render. The wiki-link and the
==highlight==are flagged, because GitHub prints them as literal text. The local image is flagged too. - GFM without HTML (many blogs): everything above, plus the alert and the math are flagged, because most blog engines show an alert as a plain quote and leave math as raw dollar signs.
- Strict CommonMark: the same again, and any tables, task lists, strikethrough or footnotes elsewhere in the post would be flagged too, because they’re GFM extensions rather than CommonMark.
Same five lines, four different answers. You find out in the editor, not in the comments under your published post.
1. A preview that follows your target’s rules
Pick where your writing is going, and the preview, the checks and the toolbar warnings all follow that choice:
| Target | For |
|---|---|
| Strict CommonMark | Any engine that follows the spec, with no extensions |
| GFM extended | GitHub and similar: GFM plus alerts, math and Mermaid |
| GFM without HTML | Blogs and docs sites that strip raw HTML |
| Wiki notes | Notes apps: GFM extended plus wiki-links and highlights |

The preview never adds anything the file doesn’t say. It adds no synthetic line breaks, no smart quotes and no preview-only syntax. Math and Mermaid only render on targets that support them; elsewhere they stay as source, just as they would where you publish.
The raw Markdown is the single source of truth. Nothing rewrites it behind your back, and nothing adds proprietary syntax.
2. A portability checker that points at the exact line
This is the heart of mdstudio. A checker reads your document and flags anything that won’t travel to the target you picked:
- Raw HTML
- Local file paths and base64 images
- Local links
- Wiki-links and
==highlights== - Math and Mermaid diagrams
- Trailing-space line breaks, the invisible kind that break silently
- Missing alt text
- HTML tags that are opened but never closed, which can swallow the rest of a page
:::custom containers, which only a few site generators understand- GitHub-style alerts outside the targets that render them
- Tables, task lists, strikethrough and footnotes when you’re writing for strict CommonMark
- Code fences without a language, so nothing gets syntax highlighting
- Lists that mix
-,*and+markers
Issues come in three levels. Errors will break on your target, such as raw HTML on a platform that strips it. Warnings will probably look wrong. Info items are style suggestions that won’t break anything but make your Markdown cleaner and more predictable. The checker also understands context: dollar amounts like $5 and $10 aren’t mistaken for math, and dollar signs inside code aren’t either.

Every issue is clickable and jumps straight to the line. You can also:
- Turn rules on or off to match how you write.
- Set publication standards, such as title and description length or required front matter fields.
- Write your own rules and share them with your team as a file.
- Fix with AI on any flagged issue, if you’ve added your own AI key. More on that below.
3. Write together in real time
Invite people by email, and up to three of you can edit the same draft at once:
- Live cursors, so you can see who’s typing where.
- Your own Undo only reverts your own edits, never someone else’s.
- It works offline. Edits made without a connection stay on your device and merge when you reconnect. If two people change the same spot, both keep their text.

The engine underneath is a CRDT (Yjs), so there’s no “last save wins” and no lost paragraphs.
4. Share for review, with inline comments
When a draft needs a second pair of eyes:
- Publish a read-only copy at an unguessable link that expires on its own after 1 to 7 days.
- Make it public, or limit it to people you name.
- Reviewers select the exact words they want to comment on, and the comments sit beside the text.
- You resolve comments from the editor, where you’re already working.



Editing your draft doesn’t change the shared copy until you publish an update, so reviewers never see half-finished edits. You can stop sharing at any time.
5. Publish straight to GitHub
Connect your GitHub account, pick a repository, a branch and a path, then:
- Commit to a branch,
- open a pull request, or
- post a gist,
all from the editor. Local images are committed beside the file, so they don’t break. mdstudio remembers where each draft went, so the next publish is one click.

Not on GitHub? You can also export clean Markdown or standalone HTML and publish anywhere.
6. A complete writing environment
mdstudio isn’t just a checker bolted onto a textarea.
Writing
- A CodeMirror 6 editor with syntax highlighting, search, line numbers and keyboard shortcuts.
- A formatting toolbar that covers every Markdown and GFM construct: headings, lists, task lists, tables, links, images, code blocks, footnotes, alerts, math and diagrams. It warns you when the target you picked doesn’t support what you’re inserting.
- KaTeX math and Mermaid diagrams, loaded only when you use them.
- Split view, editor only, preview only, and a focus mode, with the editor and preview scrolling in sync.
- A live outline of your headings, a visual front matter form (title, slug, date, cover image, description, tags, canonical URL, draft flag), and word count with reading time.

Getting content in and out
- Paste from Google Docs, Notion or any web page, and get clean Markdown.
- Import
.mdfiles, whole ZIP archives or folders. - Export plain Markdown, self-contained Markdown with images embedded, standalone HTML with its styles, or every draft as one ZIP.

Keeping track
- Folders, tags and full-text search across every draft.
- One search box (Ctrl/⌘ K) for drafts, the words in them, headings, commands and settings.
- Version history with a side-by-side diff and one-click restore. Restoring keeps the version it replaces, so you never lose text.


Anywhere
- A real phone layout, with an Editor/Preview toggle and the panels in bottom sheets.
- Light and dark themes.
- Install it as an app, and it keeps working with no connection.

7. AI that uses your key and asks before it changes anything
AI is optional, and it’s built the way it should be:
- Bring your own key for OpenAI, Anthropic, Google Gemini, Ollama, or any OpenAI-compatible gateway such as OpenRouter or Groq.
- Your key stays in memory for the session. It’s never saved, and it never passes through mdstudio’s servers. Requests go straight from your browser to your provider.
- Rewrite, shorten, translate or proofread a selection, or Fix with AI on a flagged check. It can also suggest a title, description and tags.
- Every change is shown as a diff that you accept or reject. Nothing touches your draft without your say-so.

8. Local-first: your words stay yours
- No account needed. Writing, previewing, checking, importing and exporting all work without one.
- Drafts save as you type to your browser’s own storage.
- It works offline once the page has loaded.
- The cloud is opt-in, per draft. Sign up with a confirmed email to sync drafts across devices, write together, share for review or publish to GitHub. Only the drafts you choose leave your device.
9. Free, open source, and yours to run
- MIT licensed. Read it, fork it, change it.
- One
docker compose upruns the whole thing on your own server, with your own database and storage. - No lock-in. Your writing is plain Markdown, so you can leave any time with nothing to convert.
A tour: from blank page to merged pull request
Here’s how a typical piece of documentation moves through mdstudio.
1. Start writing. Open the site and click Start writing. There’s no sign-up form and no onboarding tour. The draft saves to your browser as you type, and a save status tells you when it’s done.
2. Bring in what you already have. If your notes live in Google Docs or Notion, copy them and paste. mdstudio turns the formatting into clean Markdown: headings stay headings, lists stay lists, links keep their addresses. If you have a folder of .md files, import the whole folder or a ZIP of it at once.
3. Pick your target. The post is going to your project’s GitHub repository, so choose GFM extended. The preview now renders exactly what GitHub will, and the checks panel lists anything that won’t survive the trip.
4. Fix what’s flagged. Click each issue to jump to its line. Swap the wiki-link for a normal link, give the screenshot some alt text, replace the two trailing spaces with a proper line break. If you’ve added an AI key, Fix with AI proposes a change and shows it as a diff first.
5. Fill in the front matter. Open the front matter form and add the title, description and tags. If you’ve set publication standards, such as “the description must be under 160 characters”, the checker tells you when you’re over.
6. Get feedback. Put the draft in your cloud and share a review link with your teammates or reviewer for a maximum of 7 days. They comment on the exact sentences they want changed. You resolve each comment from the editor as you fix it.
7. Polish it together. One teammate wants to rewrite the installation section with you. Invite them, and you both edit the same draft at once, each with your own cursor and your own Undo.
8. Publish. Choose Publish to GitHub, pick the repository, a new branch and docs/getting-started.md, and open a pull request. The images go into the same commit, next to the file. Your draft remembers the destination, so the next update is one click.
Every step runs in one browser tab, and you don’t copy and paste between tools at any point.
Under the hood
For the developers reading, here’s what mdstudio is built on and why.
One Markdown pipeline. Parsing, the preview, the checker, front matter and every export all go through a single pipeline. There’s no second parser to disagree with the first, so what the checker sees is exactly what the preview renders and what the export writes.
Sanitized rendering. All rendered HTML passes through rehype-sanitize before it reaches the page. KaTeX runs with trust: false, and Mermaid runs in its strict security mode. A document can’t run scripts in your browser, even if you paste in something hostile.
A fast editor. The editor is CodeMirror 6. The preview only replaces the parts of the page that changed, so it stays smooth on long documents, and KaTeX and Mermaid load only when a draft actually uses them.
Real-time editing that survives being offline. Editing together uses Yjs, a CRDT. Each change is merged by its position in the text, not by who saved last, so two people can edit the same paragraph, even offline, and both changes survive.
Cloudflare for the hosted version. The hosted site runs on Cloudflare Workers, with D1 (SQLite) for data and R2 for files (this part is left pending for now), inside the free tiers. The self-hosted Docker image runs the same app on Node.js with an embedded SQLite file. Both share one Drizzle schema, so the code paths are the same wherever you run it.
Local storage that belongs to you. Drafts live in your browser’s IndexedDB. The cloud is an optional layer on top, not the place your writing lives.
How mdstudio compares
| Typical online editor | Notes app | Collaborative pad | mdstudio | |
|---|---|---|---|---|
| Preview follows your target’s rules | ✗ | ✗ | ✗ | ✓ |
| Flags what won’t render where you publish | ✗ | ✗ | ✗ | ✓ |
| Works without an account | Sometimes | ✓ | ✗ | ✓ |
| Real-time co-editing, also offline | ✗ | Rarely | ✓ | ✓ |
| Review links with comments on selected text | ✗ | ✗ | Sometimes | ✓ |
| Commit, pull request or gist to GitHub | Sometimes | ✗ | Sometimes | ✓ |
| AI on your own key, shown as a diff | ✗ | Sometimes | ✗ | ✓ |
| Open source and self-hostable | Sometimes | Rarely | Sometimes | ✓ |
Other editors are great at what they do. A notes app is a fine place to think, and a collaborative pad is a fine place to brainstorm. mdstudio isn’t trying to be either. It’s where you write, check, review and publish from, built for when the Markdown has to work somewhere else.
Who it’s for
- Developers writing READMEs and docs who want a second pair of eyes before the pull request.
- Technical bloggers who cross-post to dev.to, Hashnode, Medium or their own site.
- Docs teams who review and edit together without leaving Markdown.
- Notes writers moving work out of Obsidian or a similar app and into the wider world.
If you’ve ever said “but it looked fine in the editor”, the checker alone will pay for itself, and it’s free.
Frequently asked questions
Is mdstudio really free?
Yes. The code is MIT licensed and the hosted site is free to use. It has fair-use limits: by default you can keep 5 drafts in your cloud, while drafts in your browser are unlimited. If you need more, run your own copy with Docker and set your own limits.
Do I need to create an account?
No. Writing, previewing, checking, importing and exporting all work without one. An account adds the features that need a server: syncing across devices, editing together, review links and publishing to GitHub. You can sign up with an email address you confirm, or with GitHub or Google.
Where are my drafts stored?
In your browser, on your device. A draft goes to the server only when you put it in your cloud, and then only that draft. On a self-hosted copy, it goes to your own database.
Does it work offline?
Yes. Once the page has loaded, you can write, preview, check and export with no connection. Install it as an app and it opens offline too. Edits to a shared draft made offline merge when you reconnect.
Can I use it for Obsidian notes?
Yes. Pick the Wiki notes target and wiki-links and highlights render as they do in your notes app. When you’re ready to publish a note somewhere else, switch the target, and the checker lists exactly what to change.
Is my AI key safe?
Your key stays in memory for the session only. It isn’t saved in your browser’s storage, it isn’t sent to mdstudio’s servers, and requests go straight from your browser to your provider. Close the tab and it’s gone.
Can my team use it?
Yes. Up to three people can edit one draft at the same time, and reviewers comment on a shared copy. For a whole team, self-host it and you control the accounts, the limits and the data.
Learn more
The guides go deeper into where Markdown flavours differ:
- CommonMark vs GitHub Flavored Markdown
- Markdown for blogging platforms
- From Obsidian to GitHub Markdown
- Markdown line breaks
- Math and diagrams in Markdown
If it saves you from one broken post, a ⭐ on GitHub and sharing would helps other writers find it. You can also buy me a coffee to support the development