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 completegfm plugin, which includes all GFM features:
Using Individual Plugins
You can also use specific GFM features individually:- Tables Only
- Strikethrough Only
- Task Lists
Available Plugins
Theturndown-plugin-gfm package exports the following plugins:
Complete Example
Here’s a comprehensive example demonstrating all GFM features:Combining with Custom Rules
You can combine the GFM plugin with custom rules:Plugin Order
When using multiple plugins, order matters: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