remark-gfm
Remark plugin adding GitHub Flavored Markdown support for tables and strikethrough.
3. Used by agents' projects
Dependency in 231 public GitHub projects set up for AI coding agents that we scanned (3.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What remark-gfm does
remark-gfm adds GitHub's five markdown extensions to a remark pipeline for both parsing and serializing, leaves HTML output to other plugins, and its README names the cases where a different package fits better.
remark-gfm popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How remark-gfm is used
- remark-gfm is a dependency in 231 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (4.7% of the 4,867 JavaScript/TypeScript ones), #2 of 149 in markdown, editors and content.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 921; those are left out of every share on this page.
- Projects that use it most often also use react-markdown (71.4%), React (94.8%), Lucide React (72.3%).
By coding agent
Often used with
remark-gfm in practice
Strengths
The README says the plugin adds support for both parsing and serializing the extensions. Its own example runs <code>remark().use(remarkGfm)</code> to reformat a table.
A <code>stringLength</code> option lets table cells be measured by visual width. The README shows <code>string-width</code> fixing misaligned pipes around full-width characters and emoji.
The maintainers write that users often believe autolink literals and tables are part of normal markdown. They say the plugin helps match an implementation to that understanding.
The README says use of the plugin "does not involve" rehype (hast) or user content. On that basis it states there are no openings for cross-site scripting.
Watch out for
The plugin does not turn markdown into HTML. The README points to <code>remark-rehype</code> for how that happens and how to change it.
The README says that if your content is not in English and uses footnotes, you should configure <code>remark-rehype</code>.
v4 works with <code>remark-parse</code> 11+ (<code>remark</code> 15+). v3 worked with <code>remark-parse</code> 10 (<code>remark</code> 14), and v2 with <code>remark-parse</code> 9 (<code>remark</code> 13). Earlier <code>remark-parse</code> versions had a built-in <code>gfm</code> option instead.
Markdown with GFM to HTML
import rehypeStringify from 'rehype-stringify'
import remarkGfm from 'remark-gfm'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import {read} from 'to-vfile'
import {unified} from 'unified'
const file = await unified()
.use(remarkParse)
.use(remarkGfm)
.use(remarkRehype)
.use(rehypeStringify)
.process(await read('example.md'))
console.log(String(file))More about remark-gfm
Funding
- GitHub Sponsors: https://github.com/unifiedjs
- Open Collective: https://opencollective.com/unified
- thanks.dev: https://thanks.dev/u/gh/remarkjs
- 25 GitHub sponsors
Packages around it
- react-markdown: Markdown rendering in React
- lucide-react: Icon set
- tailwind-merge: Tailwind class merging
- clsx: Class name joining
- class-variance-authority: Component variants
- react: UI library
More in Markdown, editors and content
Alternatives
remark-gfm This page
Get started
Install it.
npm install remark-gfmRules for your agent
## remark-gfm
- The package is ESM only. Import it as `import remarkGfm from 'remark-gfm'`; it exports no identifiers besides the default export.
- Match versions: `remark-gfm@4` works with `remark-parse` 11+ (`remark` 15+). v3 worked with `remark-parse` 10, v2 with `remark-parse` 9.
- To get HTML, chain `.use(remarkParse).use(remarkGfm).use(remarkRehype).use(rehypeStringify)`. remark-gfm does not turn markdown into HTML.
- If the content is not in English and uses footnotes, configure `remark-rehype`, as the README advises.
- Pass `{singleTilde: false}` if `~one~` should not become strikethrough.
- When formatting tables with full-width characters or emoji, pass `{stringLength: stringWidth}` from `string-width`.
- If the goal is only markdown to HTML, the README recommends `micromark` with `micromark-extension-gfm` instead.