Project: remarkjs/remark-gfm

Package: remark-gfm@2.0.0

  1. Dependents: 153
  2. remark plugin to support GFM (autolink literals, strikethrough, tables, tasklists)
  1. remark 190
  2. unified 174
  3. plugin 137
  4. markdown 131
  5. mdast 85
  6. remark-plugin 73
  7. gfm 18
  8. table 12
  9. github 9
  10. strikethrough 6
  11. autolink 5
  12. tasklist 3


Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to support GitHub Flavored Markdown.


This plugin is made for the new parser in remark (micromark, see remarkjs/remark#536). While you’re still on remark 12, use the gfm option for remark. Use this plugin for remark 13+.


This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.


npm install remark-gfm


Say we have the following file, example.md:


## Autolink literals

www.example.com, https://example.com, and contact@example.com.

## Footnote

A note[^1]

[^1]: Big note.

## Strikethrough

~one~ or ~~two~~ tildes.

## Table

| a | b  |  c |  d  |
| - | :- | -: | :-: |

## Tasklist

* [ ] to do
* [x] done

And our module, example.js, looks as follows:

import {readSync} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm'
import remarkRehype from 'remark-rehype'
import remarkStringify from 'rehype-stringify'

  .then((file) => {

Now, running node example yields:

example.md: no issues found
<h2>Autolink literals</h2>
<p><a href="http://www.example.com">www.example.com</a>, <a href="https://example.com">https://example.com</a>, and <a href="mailto:contact@example.com">contact@example.com</a>.</p>
<p>A note<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref aria-describedby="footnote-label">1</a></sup></p>
<p><del>one</del> or <del>two</del> tildes.</p>
<th align="left">b</th>
<th align="right">c</th>
<th align="center">d</th>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" disabled> to do</li>
<li class="task-list-item"><input type="checkbox" checked disabled> done</li>
<section data-footnotes class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<li id="user-content-fn-1">
<p>Big note. <a href="#user-content-fnref-1" data-footnote-backref class="data-footnote-backref" aria-label="Back to content"></a></p>


This package exports no identifiers. The default export is remarkGfm.

unified().use(remarkGfm[, options])

Configures remark so that it can parse and serialize GFM (autolink literals, footnotes, strikethrough, tables, tasklists).


Whether to support strikethrough with a single tilde (boolean, default: true). Single tildes work on github.com, but are technically prohibited by the GFM spec. Passed as singleTilde to micromark-extension-gfm-strikethrough.


Create tables with a space between cell delimiters (|) and content (boolean, default: true). Passed to mdast-util-gfm-table.


Align the delimiters (|) between table cells so that they all align nicely and form a grid (boolean, default: true). Passed to mdast-util-gfm-table.


Function passed to markdown-table to detect the length of a table cell (Function, default: s => s.length). Used to align table cells. Passed to mdast-util-gfm-table.


Use of remark-gfm does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks.


See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.


MIT © Titus Wormer