GitHub Flavored Markdown: Extensions, Tables, and Task Lists

May 28, 20266 min read

What Is GitHub Flavored Markdown?

GitHub Flavored Markdown (GFM) is GitHub's extension of the CommonMark specification. It adds features that developers and writers need every day — tables, task lists, strikethrough, autolinks, and stricter HTML filtering.

GFM is not a separate language. It builds on CommonMark as a strict superset: every valid CommonMark document is valid GFM, but GFM adds syntax that CommonMark does not recognize. Most modern Markdown parsers support GFM by default.

GFM vs CommonMark: Key Differences

Understanding what GFM adds helps you write Markdown that works consistently across platforms.

FeatureCommonMarkGFM
TablesNoYes
Task listsNoYes
StrikethroughNoYes
Autolinks (bare URLs)Requires <url>Automatic
Disallowed raw HTMLNo filteringStrips dangerous tags
Heading IDsNot specifiedAuto-generated

If your content uses any feature in the GFM column, you need a GFM-compliant parser. CommonMark parsers will render those sections as plain text or ignore them.

Tables

Tables are the most-requested GFM feature. They turn data into scannable, aligned columns.

Basic Syntax

| Language   | Year | Paradigm      |
|------------|------|---------------|
| Python     | 1991 | Multi-paradigm|
| Rust       | 2010 | Systems       |
| TypeScript | 2012 | Object-oriented|

Column Alignment

Colons in the separator row control alignment:

| Left      | Center       | Right      |
|:----------|:------------:|-----------:|
| Default   | Centered     | Numbers    |
| Aligned   | Text         | Align here |
  • :--- — left-aligned (default)
  • :---: — center-aligned
  • ---: — right-aligned

Table Tips

  • You do not need to align pipes visually — parsers ignore extra spaces
  • Blank cells are fine: | | | renders as empty <td> elements
  • Tables do not support row spans or column spans — use HTML <table> markup only if absolutely necessary
  • Keep tables narrow. Wide tables break on mobile; consider bullet lists as an alternative

Task Lists

Task lists add interactive checkboxes to your Markdown. On GitHub, they render as clickable toggles in issues, pull requests, and comments.

Syntax

- [x] Set up CI pipeline
- [x] Write unit tests
- [ ] Add integration tests
- [ ] Deploy to staging

Use Cases

  • Pull request descriptions — track what a PR covers at a glance
  • Issue templates — give contributors a checklist to follow
  • Project READMEs — show progress on planned features
  • Meeting notes — assign and track action items

Compatibility Note

Outside GitHub, task lists typically render as static checkboxes (checked or unchecked icons). They are not interactive in static-site generators unless you add custom JavaScript.

Strikethrough

Double tildes strike through text:

This feature is ~~deprecated~~ legacy — use the new API instead.

Renders as: This feature is deprecated legacy — use the new API instead.

Common uses:

  • Marking outdated information while keeping it visible for context
  • Showing before/after edits in documentation
  • Tracking changes in meeting notes without deleting the original

GFM automatically turns bare URLs and email addresses into clickable links — no angle brackets needed.

Visit https://github.com for the source code.
Contact support@example.com for help.

CommonMark requires <https://github.com> syntax. GFM removes that friction.

URL Break Detection

GFM handles URLs that wrap across lines and strips trailing punctuation (periods, commas, parentheses) from links. This prevents sentences like "See https://example.com." from including the period in the URL.

Code Blocks and Syntax Highlighting

GFM supports fenced code blocks with optional language hints — identical to standard Markdown but with better support on GitHub's platform.

```python
def fibonacci(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a
```

GitHub-Specific Highlighting

GitHub uses Linguist to detect languages and apply syntax highlighting. Language hints override auto-detection:

HintLanguage
js or javascriptJavaScript
ts or typescriptTypeScript
py or pythonPython
sh or bashShell
jsonJSON
yamlYAML

Always specify the language. Auto-detection fails on short snippets and ambiguous syntax.

Disallowed Raw HTML

GFM strips certain HTML tags from output to prevent security issues. The disallowed list includes:

  • <script> — prevents script injection
  • <title> — prevents page title manipulation
  • <style> — prevents style injection
  • <textarea> — prevents form manipulation
  • <xmp> — deprecated, potential XSS vector
  • <iframe> — (on some renderers) prevents framing attacks

This is a security feature, not a formatting limitation. If you need these elements, they should come from your template system, not from user-generated Markdown.

GitHub-Only Extensions

Some GFM features work exclusively on GitHub's platform:

  • Alerts — callout blocks using > [!NOTE], > [!WARNING], > [!TIP], > [!CAUTION], > [!IMPORTANT]
  • Mermaid diagrams — render flowcharts and sequence diagrams from fenced mermaid code blocks
  • Footnotes — GitHub now supports [^1] footnote syntax in issues and discussions

These features may not render correctly in other Markdown parsers. Check your target platform before relying on them.

Portability Checklist

Before publishing GFM content outside GitHub:

  1. Test tables in your target renderer — alignment and empty cells vary
  2. Replace alerts with standard blockquotes if your platform does not support them
  3. Verify autolinks — some parsers still require angle brackets
  4. Check task list rendering — interactive vs static behavior differs
  5. Strip GitHub-only features — Mermaid and alerts need plugin support

Key Takeaways

  • GFM extends CommonMark with tables, task lists, strikethrough, and autolinks
  • Tables support left, center, and right alignment via colon syntax
  • Task lists are interactive on GitHub, static elsewhere
  • GFM filters dangerous HTML tags automatically — a baseline security benefit
  • Alerts and Mermaid diagrams are GitHub-specific; plan replacements for other platforms
  • Always specify code-block language hints for reliable syntax highlighting

Try It Yourself

Put GFM syntax to the test. Open our free Markdown Preview tool, write a table or task list, and see the rendered output in real time — no GitHub repository required.