micromark-extension-gfm-task-list-item
micromark extensions that add GitHub Flavored Markdown task list checkbox syntax and HTML output.
Repository Health
Technical Analysis
micromark-extension-gfm-task-list-item adds GitHub Flavored Markdown task list item support to micromark, the small, fast, and safe streaming markdown tokenizer that powers remark and the unified ecosystem. It provides a syntax extension that teaches micromark’s state machine to recognize the [ ] and [x] checkboxes at the start of list items, plus an HTML extension that renders those checkboxes as disabled input elements like github.com does.
Because it operates at the token level, it is the lowest layer of the task list stack: when you also need a syntax tree you pair it with mdast-util-gfm-task-list-item, and when you want all of GFM you use micromark-extension-gfm. It matches GitHub’s checkbox rendering behavior for both checked and unchecked items.
What You Get
- A gfmTaskListItem syntax extension that tokenizes
[ ]/[x]checkboxes on list items - A gfmTaskListItemHtml extension that renders checkboxes as disabled input elements
- Behavior matched to github.com’s task list rendering
- Support for both checked and unchecked states
- TypeScript types and a development build with debugging assertions
Common Use Cases
- Adding task list support when using micromark directly to render markdown to HTML
- Serving as the tokenizer layer beneath mdast-util-gfm-task-list-item in a unified pipeline
- Building custom markdown-to-HTML tooling that needs GFM checklists
- Rendering interactive-looking checklists in generated documentation
Under The Hood
Architecture - The package ships two extensions. dev/lib/syntax.js (~166 lines) defines a micromark construct and tokenizer that detects a checkbox marker only at the very start of the first content in a list item, emitting task list check tokens. dev/lib/html.js (~29 lines) is a small HTML compiler extension that renders those tokens as <input type="checkbox" disabled> elements, checked or unchecked. A dev build keeps assertions while the published build strips them.
Tech Stack - Pure ESM JavaScript typed via JSDoc, built on micromark’s low-level construct/tokenizer primitives (micromark-util-* helpers). It targets modern Node.js and browsers and ships both a dev and production build.
Code Quality - The code follows micromark’s rigorous, character-level conventions with a test suite comparing output against reference fixtures. The tokenizer is small and focused, carefully guarding the position where a checkbox is valid.
API Design - The two-part syntax/HTML split matches every other micromark extension, so it plugs into micromark’s extensions/htmlExtensions option arrays with no new concepts and essentially no configuration.