Back to Blog
Markdown

GitHub Flavored Markdown: Practical Syntax Examples

Copyable examples of common GFM syntax, with renderer differences, HTML limitations, and checks for exported documents.

By MD OpenerPublished May 5, 20265 min read

Updated:

What is GitHub Flavored Markdown

GitHub Flavored Markdown (GFM) builds on CommonMark with extensions including tables, task lists, strikethrough, and extended autolinks. A renderer may support some extensions without reproducing all of GitHub’s website behavior.

Check which dialect your publishing destination accepts. You can test the snippets below in the Markdown viewer and compare them with the target renderer.

This guide covers common documentation syntax with copyable examples. It is not the complete specification; consult the official GFM specification for exact parsing rules.

Tables

Tables are the GFM feature people reach for first. They render as real HTML tables, not pipe text.

| Feature | Plain MD | GFM |
| --- | :--- | :---: |
| Tables | ❌ | ✅ |
| Task lists | ❌ | ✅ |
| Strikethrough | ❌ | ✅ |

The colons in the separator row control alignment: :--- left, ---: right, :---: center. Keep tables to a clean grid — GFM does not support merged or nested cells.

Blank lines make table boundaries easier to read. If a table fails, first check the header and separator cell counts and confirm that the renderer supports tables.

Task lists

Task lists turn bullet items into checkboxes. They are perfect for tracking steps in a README or an issue.

- [x] Set up the project
- [x] Write the docs
- [ ] Ship the release
- [ ] Collect feedback

Checked items render with a filled checkbox; unchecked items render empty. Task lists work inside both bulleted and numbered contexts, though they are most readable as bullets.

Strikethrough

Strikethrough is simple but useful for showing edits or marking obsolete content.

This feature is ~~deprecated~~ being replaced.

Wrap text in double tildes (~~like this~~) and it renders with a line through it.

GFM autolinks bare URLs and email addresses — you do not need angle brackets or Markdown link syntax.

Visit https://example.com or email [email protected].

Inside code spans and code blocks, GFM disables Markdown parsing, so you can show raw syntax without escaping:

The source contains the literal operator `||`.
```js
const merged = [...a, ...b];
```

A language tag identifies the code language. Highlighting requires a renderer that implements it; a fence alone does not guarantee colors. Use a longer outer fence when demonstrating nested fences.

Headings and the document outline

Headings are part of the CommonMark foundation that GFM uses. A logical hierarchy makes sections easier to navigate; it is one part of accessibility, not a complete accessibility check.

# Document title (H1)
## Section (H2)
### Subsection (H3)

Two habits keep outlines clean: use exactly one H1 per document as the title, and do not skip levels (jumping from H2 to H4 breaks the hierarchy that screen readers and table-of-contents tools rely on).

Lists and nesting

GFM handles ordered and unordered lists, and nests them with indentation.

1. First step
2. Second step
   - A sub-item
   - Another sub-item
3. Third step

Keep nesting shallow — two levels is usually enough — and separate list items from adjacent paragraphs with a blank line so the list renders as a list rather than running into body text.

Blockquotes

Blockquotes call out notes, warnings, or quoted material.

> This is a blockquote.
> It can span multiple lines.

They render with a visual indent and are a clean way to highlight callouts without resorting to bold shouting.

Test the features your document uses

Not every Markdown viewer supports every GFM feature. A weak renderer will show raw pipes instead of a table, or ignore task-list checkboxes. When you pick a viewer or converter, confirm it handles all of the following:

Syntax Without the relevant support With the relevant support
Tables Shows | pipes Real table
Task lists Plain bullets Checkboxes
Strikethrough Shows ~~ Line through text
Autolinks Plain text Clickable link
Fenced code (also in CommonMark) Literal fence markers Separate code block

Use the examples to check these features in the Markdown viewer. Raw HTML is omitted by the main viewer; footnotes and math are additional extensions, not proof of complete GitHub parity. A renderer that omits a feature may be designed for a different dialect rather than being broken.

Separate syntax from platform behavior

Construct Which layer to verify What MD Opener's main viewer does
Tables, task lists, strikethrough GFM extensions Renders the supported syntax
Fenced code CommonMark foundation Displays code; a language label does not promise colored highlighting
Footnotes and dollar-delimited math Additional renderer extensions Renders supported references and math
Raw HTML such as <details> HTML policy of the renderer Omits the raw HTML markup
Issue references, mentions, repository-relative assets Hosting platform and repository context Does not recreate GitHub's repository services

Test a mismatch at its own layer. A table with a missing delimiter is a source problem; an absent adjacent image is an asset problem. A mermaid code label alone does not promise that the viewer will draw a diagram.

Writing GFM that converts cleanly

The same source can be converted to HTML, PDF, or Word, but the destination representation differs. Check the exported file separately:

Task boxes may be visual symbols rather than interactive controls, and PDF headings need not become bookmarks. Test the features your recipient requires.

Try GFM now

Try a small GFM example and compare its source with the rendered result. Open the Markdown viewer, paste any snippet from this guide, and watch tables, task lists, and strikethrough come to life — with local Markdown processing. External image URLs can still contact their hosts.

Related articles

Keep reading with these related guides.