Home / Companies / GitHub / Blog / Post Details
Content Deep Dive

A formal spec for GitHub Flavored Markdown

Blog post from GitHub

Post Details
Company
Date Published
Author
GitHub Engineering
Word Count
1,917
Language
English
Hacker News Points
-
Summary

GitHub's decision to use Markdown for user content has led to the development of GitHub Flavored Markdown (GFM), a customized version built on the Sundown parser to address Markdown's inconsistencies across platforms. To enhance standardization, GitHub has released a formal specification of GFM based on CommonMark, which aims to provide a consistent Markdown syntax widely used online. This transition involved creating a specification for GFM-specific features like tables and task lists, ensuring compliance with the CommonMark standard. The implementation included a new backend based on the cmark parser, which, despite being slower than Sundown, offers improved security and functionality by generating an Abstract Syntax Tree (AST) for Markdown. To address potential rendering issues with existing content, GitHub normalized user comments, ensuring minimal impact on the user experience during the migration to CommonMark compliance. This extensive process ensured that all Markdown content on GitHub now adheres to a standardized and pragmatic approach, with ongoing efforts to align with the final CommonMark specification.