Task lists, strikethrough, footnotes, alerts

Markdown · Practical · 10 min

These features turn Markdown into a collaboration tool in issues, pull requests and READMEs.

GitHub Flavored Markdown (GFM) adds features beyond CommonMark, and GitHub adds a few more on top:

  • Task lists: - [ ] todo and - [x] done render checkboxes; in issues and PRs they're clickable and show progress.
  • Strikethrough: ~~removed~~.
  • Extended autolinks: bare https://... and www. URLs become links without angle brackets.
  • Footnotes: Text[^1] with [^1]: The note. anywhere in the document; rendered at the bottom with back-links.
  • Alerts: a blockquote starting with [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] renders as a coloured callout.
  • References in issues, PRs and comments: @user mentions, #123 issue links, commit SHAs and owner/repo#123 become links.
  • Emoji shortcodes like :rocket:.

GFM also disallows some raw HTML tags (such as <script> and <iframe>) via its tagfilter extension.

Portability varies. Task lists, tables and strikethrough are widely supported; footnotes and alerts less so; mentions and issue references only mean something on GitHub (GitLab has similar but not identical syntax). If a document is rendered in several places, such as GitHub and a docs site, check the features against both.

Example

## Release checklist

- [x] Update the changelog
- [ ] Tag the release
- [ ] ~~Announce on the mailing list~~ (moved to the blog)

> [!WARNING]
> Version 3 removes the legacy API.

Fixes #142, thanks @ana-dev. See https://example.com/notes for details.

The parser is linear-time[^re2].

[^re2]: It uses an automaton-based engine, so no input can cause backtracking.

Remember

  • - [ ] and - [x] make task lists; ~~text~~ strikes through
  • > [!NOTE] style blockquotes render as alerts on GitHub
  • Footnotes, mentions and #refs aren't supported by every renderer

Watch out for

  • Using GitHub-only features like alerts or #123 references in docs that are also rendered elsewhere.

Check yourself

  1. Which syntax creates a GitHub alert box?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts