Markdown that converts cleanly to HTML
Markdown looks forgiving, but a missing blank line quietly turns your list into a paragraph. These habits keep the converted HTML predictable.
Markdown looks forgiving, but a missing blank line quietly turns your list into a paragraph. These habits keep the converted HTML predictable.
Most Markdown bugs are blank-line bugs. Block-level elements — headings, paragraphs, lists, blockquotes, tables, fenced code — must be separated by an empty line. Without it, a parser will happily glue the next block onto the previous one:
Here is a paragraph.
## And a heading that will NOT render
vs.
Here is a paragraph.
## And a heading that will
The same applies to lists following text, and to anything following a list. If a list item needs a second paragraph, indent that paragraph by two to four spaces and leave a blank line above it.
GitHub-flavoured Markdown recognises tables by the dash row under the header — not by the pipes. A table without that row is just text with pipes in it.
| Feature | Supported |
| --- | --- |
| Tables | yes |
| Lists | yes |
Alignment comes from the same row: :--- left, :---: centre,
---: right. Keep cells short; a table wider than the page will scroll rather than wrap.
Always open a fence with three backticks and a language name. The converter passes that through as
class="language-js", which is what Prism, highlight.js and Shiki need to colour the
block later.
```js
const total = items.reduce((sum, i) => sum + i.price, 0);
```
If your code itself contains three backticks, use four backticks around the block. CommonMark allows any fence length of three or more, and the closing fence must match.
A stray <div> or an unclosed <span> from a copied snippet will
swallow everything after it, because HTML inside Markdown is rendered as-is. Converters that sanitise
(like the one here) will strip dangerous tags, but a malformed tag can still disturb structure. The
safe habit: use Markdown syntax inside documents, and reserve raw HTML for embeds you control.
Four leading spaces create a code block in classic Markdown. Copy from a PDF or a letter-template and you can accidentally turn half a page into monospace. There is a second consequence: a list item indented by four spaces is also treated as code inside that item.
Multi-line list items need their continuation lines indented to line up with the item text, otherwise the second line escapes the list:
1. First item that is long enough to wrap
onto a second line — indented by 3 spaces.
2. Second item
Inline links — [text](https://example.com/page) — are the most portable form. Reference
links, where the URL lives at the bottom of the document, are easier to maintain but frequently
break when a document is moved between systems that strip the definitions. If your converted HTML
will be pasted into a CMS, prefer inline links and absolute URLs.
The Markdown to HTML converter previews as you type, so the blank-line problems above are visible immediately. It sanitises the output with DOMPurify, meaning scripts and inline event handlers never make it into the HTML you copy — an important detail if you paste drafts from other people.
If you also need to tidy the HTML file you generate, the Code Prettifier will format it with Prettier’s HTML parser.
Preview, sanitise, copy the fragment or export a full page.