Markdown Indented Code Blocks
Last updated: 2026-10-14
Indented Code Blocks CommonMark core
A paragraph indented by 4 spaces (or a tab) becomes a code block — Markdown's oldest code syntax, no language tag, no highlighting. Before fences existed, this was the only way.
| Group | Edge Cases & Rules |
|---|---|
| Spec level | CommonMark core |
| Spec version | CommonMark 0.31.2 + GFM |
📝 Syntax
(blank line first)
content indented 4 spaces
▶ Live Example
Edit Markdown on the left, see the result on the right
💡 Key points
⚠️ Warning Content is fully literal: no Markdown parsing inside — a limit and a demo feature.
💡 Tip Prefer fenced blocks today: language tags and saner behavior inside lists.
❓ FAQ
Q Can I write Markdown inside?
A No, everything is literal — which makes it great for syntax demos.
Q How to indent a block inside a list?
A Indent to the item's text start, not a flat 4 spaces.
Q How wide is a tab?
A Expanded at tab stops: one tab counts as 4 spaces; mixing causes bugs.