Skip to main content

How is GFM different from CommonMark?

· 3 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

GitHub Flavored Markdown (GFM) is a strict superset of the CommonMark specification. This means that GFM includes all the features of CommonMark and adds several of its own, making it a more feature-rich dialect of Markdown.

The key differences between GFM and CommonMark lie in the extra features GFM provides to support the collaborative nature of a platform like GitHub.

Key Differences

FeatureCommonMarkGFM
TablesNot supported by default.Supported. Uses pipe `
Task ListsNot supported.Supported. Creates interactive checkboxes in lists.
StrikethroughNot supported.Supported. Uses two tildes ~~ to cross out text.
AutolinksRequires angle brackets <...> for URLs.Enhanced. Automatically links URLs and email addresses without brackets.
MentionsNot supported.Supported. Automatically links @username to a user's profile.
ReferencesNot supported.Supported. Links #issue-number and commit_sha to issues and commits.
Disallowed HTMLAllows a wider range of raw HTML.Stricter. Sanitizes or disallows certain HTML tags for security.

Why GFM is More Useful on GitHub

GFM's additions are specifically designed to enhance communication and collaboration within a software development context. For example:

  • Task lists are essential for managing to-do items directly within issues or pull requests.
  • Mentions and references (#123 or git-sha) create a powerful web of links that connect discussions, code, and commits, making project history easy to navigate.
  • Tables and strikethrough provide simple ways to organize information and communicate changes clearly.

While a document written in CommonMark will render correctly on GitHub, it cannot take advantage of these platform-specific features.