GitHub-Flavored Markdown (GFM): Tables, Task Lists and More
By VeloForge Labs · · 2 min read
Standard Markdown, as defined by CommonMark, covers headings, emphasis, lists, links, images, code and quotes. GitHub-Flavored Markdown (GFM) is a superset that adds a handful of features people expect from modern writing tools. It is documented in the GFM spec, which is built on top of CommonMark.
What GFM adds
Tables
Pipes and a separator row create a table. Colons in the separator row set column alignment.
| Plan | Requests | Price |
|:-----|:--------:|------:|
| Free | 100/day | ₹0 |
| Pro | 50,000 | ₹799 |
Left, center and right alignment come from :---, :---: and ---:.
Strikethrough
Wrap text in two tildes to cross it out:
The price is ~~₹999~~ ₹799.
Task lists
A list item that starts with [ ] or [x] becomes a checkbox item:
- [x] Write the draft
- [ ] Proofread
- [ ] Publish
The output is an HTML checkbox input inside the list item. Be aware that many sanitizers remove <input> elements by default, so a task list may render as plain bullets after sanitizing. If checkboxes matter to you, check what your sanitizer keeps.
Autolinks
In GFM, a bare URL such as https://example.com becomes a clickable link without angle brackets or link syntax.
Fenced code blocks
Three backticks or three tildes open a code block, and an info string names the language. Standard CommonMark has fenced code too, but GFM popularized the pattern, and your highlighter can use the language name as a class.
When to enable GFM
Turn GFM on when your writers want tables or strikethrough, which is almost always the case for documentation, issue trackers, comments and READMEs. Turn it off only when you must match a strict CommonMark pipeline and want pipes and tildes treated as ordinary text.
In the TexToolsAI API, GFM is on by default. To switch it off, pass "options": {"gfm": false}:
curl -X POST https://texttoolsai.org/api/convert \
-H "Authorization: Bearer tt_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "| a | b |\n|---|---|\n| 1 | 2 |", "options": {"gfm": false}}'
With GFM on, that input produces an HTML <table>. With it off, you get a plain paragraph containing the pipe characters.
Line breaks
Standard Markdown treats a single newline inside a paragraph as a space. GitHub comments treat it as a line break. Parsers expose this as a separate setting, often called "breaks". The TexToolsAI API converts single newlines into <br> tags, which matches what people expect when typing in a comment box.
Safety still applies
GFM does not make Markdown safe. Tables and autolinks still produce HTML that has to be sanitized. Read Why Markdown is not safe by default for the details, or paste your own GFM into the playground to see the sanitized output. A quick syntax reference is in the Markdown cheat sheet.