mdformat-gfm
Mdformat plugin for GitHub Flavored Markdown compatibility
What it is and what it does
Mdformat-gfm is a plugin for mdformat that shifts the formatting target from CommonMark to GitHub Flavored Markdown. It enables mdformat to understand and preserve GFM-specific syntax extensions: tables, task list items (checkboxes), strikethroughs, autolinks, and raw HTML handling rules. The plugin is installed via pipx injection into an existing mdformat installation and integrates as a drop-in formatter for GFM-heavy projects.
The package depends on mdformat as its core formatter, along with markdown-it-py and mdit-py-plugins for parsing, and wcwidth for text measurement. It adds a `--compact-tables` CLI flag to strip alignment spaces from tables, and can be configured via `.mdformat.toml` for persistent settings. This is useful for teams using GitHub as their primary documentation platform or for projects that rely on GFM syntax in their markdown workflows.
Use it for:
- Format markdown documentation in GitHub repositories that use tables and task lists.
- Enforce consistent GFM syntax style across a project's README and wiki files.
- Automatically compact GFM tables to reduce whitespace in version-controlled markdown.
- Integrate GFM formatting into CI/CD pipelines for documentation linting.
- Convert and reformat CommonMark documents to GitHub Flavored Markdown syntax.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Mdformat-gfm extends mdformat to format GitHub Flavored Markdown, adding support for tables, task lists, strikethroughs, autolinks, and disallowed raw HTML syntax.
Yes, if you format GFM markdown regularly. The package is actively maintained, has no known vulnerabilities, installs cleanly, and is MIT-licensed. It's a straightforward plugin for mdformat that adds necessary GFM support without friction. Install it if your workflow involves GitHub markdown; skip it if you only use CommonMark.
Install
mdformat-gfm on PyPI
pip
pip install mdformat-gfmuv
uv add mdformat-gfmpoetry
poetry add mdformat-gfmInstalling mdformat-gfm
Before you install
Low install friction with a pure-Python wheel. Maintenance is active with a recent release and ongoing commits; the package is in the top 5000 by downloads.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it safe for most projects.
Quickstart
pipx install mdformat
pipx inject mdformat mdformat-gfm
mdformat --gfm file.md
Requires Python 3.10 or later.
Verify before relying
- Whether compact_tables option works correctly with all GFM table edge cases.
- Performance characteristics when formatting very large markdown files with complex tables.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — mdformat, markdown-it-py, mdit-py-plugins, wcwidth |
| Maintenance | actively maintained — 302 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,422,590/month — #3,922 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mdformat_gfm-1.0.0-py3-none-any.whl
Keywords: mdformat, markdown, formatter, gfm
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
mdformatMdformat is a CommonMark-compliant command-line…
permissive · top 5,000 on PyPI
mdformat-gfm-alertsA plugin for mdformat that formats GitHub…
permissive · top 15,000 on PyPI
py-gfmConverts GitHub-Flavored Markdown to HTML using…
permissive · top 15,000 on PyPI
mdformat_mystmdformat-myst is an mdformat plugin that…
permissive · top 15,000 on PyPI
mdformat_tablesmdformat-tables is a plugin for mdformat that…
permissive · top 15,000 on PyPI
mdformat-ruffIntegrates ruff code formatting into mdformat…
permissive · top 15,000 on PyPI
multimarkConverts Markdown to HTML, LaTeX, groff man,…
permissive · top 15,000 on PyPI
mdformat-tocMdformat-toc is an mdformat plugin that…
permissive · top 15,000 on PyPI
cmarkgfmConverts CommonMark and GitHub-flavored…
permissive · top 15,000 on PyPI
gdtoolkitGDScript parser, linter, formatter, and code…
permissive · top 15,000 on PyPI