Markdown Cheatsheet - Markdown Syntax Reference
Markdown parsing differs across platforms — GitHub, GitLab, VitePress and others each emphasize different subsets. This reference gathers the widely-supported basics plus each platform's GFM extensions, organized by feature (headings, lists, tables, code blocks, …), so you produce docs that render correctly everywhere and know which syntax is not portable. After reading you pick the safest construct instead of discovering breakage after publishing.
Heading 5
# H1## H2### H3Title\n===Title\n---Text Style 7
**bold***italic****bold italic***~~strikethrough~~`inline code`> quote> > nested quoteList 5
- Unordered item1. Ordered item- [ ] Todo- [x] Done - Indented sub-itemCode Block 4
```python``` 4-space indent code```{bash eval=true}Link & Image 5
[text](https://example.com)[text](https://example.com "title")[text][ref]\n\n[ref]: https://example.com[text](#anchor-id)Table & HR 5
---| Col1 | Col2 |\n| --- | --- |\n| a | b || :--- || :---: || ---: |Tips
- Use <br> for line breaks inside tables — Markdown tables don't support native line breaks.
- When backticks conflict inside code blocks, use more backticks for fencing (e.g., ~~~~ around content containing ```).
- GFM (GitHub Flavored Markdown) supports task lists, strikethrough, auto-links, and tables — more features than standard Markdown.
FAQ
My Markdown image uses a relative path but breaks after publishing — why?
Relative paths resolve against the Markdown file's own directory, so images under ./images referenced as  only render if they are deployed too and the site does not rewrite URLs. In GitHub repos relative paths work but are case-sensitive; for documentation sites on an image CDN, use the full URL instead.
How do I put a pipe or line break inside a Markdown table cell?
Columns are separated by pipes, so escape a literal pipe inside a cell as \|. For a line break use <br>; a natural Markdown line break collapses to a space inside a cell. Keep cells short and prefer blockquotes or lists for heavier layout.
Do I need to specify the language for a Markdown code block?
Wrap code in triple backticks and put the language right after, e.g. ```javascript, for highlighting. Some platforms also accept four-space indented blocks, and single backticks are for inline code. Common identifiers like javascript, typescript, bash, json and python are recognized by most engines.
How do I write long links or reference-style links in Markdown?
Inline is [text](https://...), but long URLs clutter the doc. Reference-style links define [key]: https://... in a link list once and use [text][key] anywhere, so changing one URL updates every reference. Bare URLs are auto-linked on many sites.
Why does my Markdown look fine locally but break on GitHub?
Each platform parses a slightly different dialect. GitHub uses GFM with task lists, autolinks, @mentions and table highlighting, but is stricter about blank lines and indentation and sanitizes some raw HTML. Local previews differ too, especially around line breaks. Stick to portable core syntax (brackets, asterisks, backticks) and preview on the target platform before publishing.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us