Skip to main content

What is the GFM Plugin?

The turndown-plugin-gfm extends Turndown with support for GitHub Flavored Markdown (GFM) features that aren’t part of the CommonMark specification. This includes:
  • Tables - Convert HTML tables to Markdown pipe tables
  • Strikethrough - Convert <del>, <s>, and <strike> to ~~strikethrough~~
  • Task lists - Convert checkboxes to - [ ] and - [x] syntax
  • Autolinks - Improved handling of URLs
The GFM plugin is maintained as a separate package and must be installed alongside Turndown.

Installation

Install both Turndown and the GFM plugin:

Using the Complete GFM Plugin

The simplest approach is to use the complete gfm plugin, which includes all GFM features:
Output:

Using Individual Plugins

You can also use specific GFM features individually:
Output:

Available Plugins

The turndown-plugin-gfm package exports the following plugins:

Complete Example

Here’s a comprehensive example demonstrating all GFM features:
Output:

Combining with Custom Rules

You can combine the GFM plugin with custom rules:

Plugin Order

When using multiple plugins, order matters:
Custom rules added via addRule() take precedence over plugin rules. Add plugins before custom rules if you want to override plugin behavior.

Browser Usage

The GFM plugin can be loaded via CDN for browser usage:

Next Steps

Custom Rules

Learn how to create your own conversion rules

Options Reference

Explore all available configuration options