DEV Community

Robert Wallace
Robert Wallace

Posted on

How to Fix Messy Markdown from Notion or Obsidian

If you’ve ever exported from Notion or Obsidian, you know the pain: extra whitespace everywhere, empty links, inconsistent heading styles, and stray HTML that breaks your site or docs build.

The good news is the content is usually fine. It just needs normalization.

Headings are the first thing I fix. Exports often start with H2 or mix H1 and H2 depending on how the document was structured. Pick a single top-level heading style and normalize everything down to it. Tools that rewrite headings automatically save more time than manually editing each file.

Then I remove empty bullets and blank lines. They look harmless in an editor, but they show up as layout problems in static site generators and markdown linters. Stripping them out before import prevents a lot of downstream noise.

Links are the next cleanup step. Exported docs love to include anchors to nowhere — placeholders, internal cross-references, or empty hrefs. Removing those late is worth it because broken links are harder to spot once the content is staged.

Finally, code fences should have language tags. Obsidian usually preserves them; Notion often drops them. Adding them back makes the content readable in GitHub, dev.to, or any docs renderer.

If you’re pasting a doc into a markdown cleaner, the fastest workflow is: normalize headings, remove empty bullets, strip dead links, then verify the result in a renderer before using it in production.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)