What is micromark-extension-gfm-task-list-item?
The micromark-extension-gfm-task-list-item package is an extension for micromark that adds support for GitHub Flavored Markdown (GFM) task list items. This allows you to parse and render task lists in markdown documents.
What are micromark-extension-gfm-task-list-item's main functionalities?
Parse GFM Task List Items
This feature allows you to parse GFM task list items from markdown input. The code sample demonstrates how to use the micromark-extension-gfm-task-list-item extension to parse a markdown string containing task list items.
const micromark = require('micromark');
const gfmTaskListItem = require('micromark-extension-gfm-task-list-item');
const input = '- [ ] Task 1\n- [x] Task 2';
const output = micromark(input, { extensions: [gfmTaskListItem()] });
console.log(output);
Render GFM Task List Items
This feature allows you to render GFM task list items to HTML. The code sample demonstrates how to use the micromark-extension-gfm-task-list-item extension along with its HTML renderer to convert a markdown string containing task list items into HTML.
const micromark = require('micromark');
const gfmTaskListItem = require('micromark-extension-gfm-task-list-item');
const html = require('micromark-extension-gfm-task-list-item/html');
const input = '- [ ] Task 1\n- [x] Task 2';
const output = micromark(input, { extensions: [gfmTaskListItem()], htmlExtensions: [html()] });
console.log(output);
Other packages similar to micromark-extension-gfm-task-list-item
remark-gfm
remark-gfm is a plugin for remark that adds support for GitHub Flavored Markdown (GFM), including task lists. It is similar to micromark-extension-gfm-task-list-item but is used within the remark ecosystem, which is another popular markdown processor.
markdown-it-task-lists
markdown-it-task-lists is a plugin for markdown-it that adds support for GFM task lists. It provides similar functionality to micromark-extension-gfm-task-list-item but is designed to work with the markdown-it parser.
markdown-it-checkbox
markdown-it-checkbox is another plugin for markdown-it that adds support for checkboxes in markdown, which can be used to create task lists. It offers similar functionality to micromark-extension-gfm-task-list-item but focuses specifically on checkboxes.
micromark-extension-gfm-task-list-item
micromark extension to support GitHub flavored markdown task list
items.
This extension matches the GFM spec for the few things it defines and otherwise
matches github.com.
This package provides the low-level modules for integrating with the micromark
tokenizer and the micromark HTML compiler.
You probably shouldn’t use this package directly, but instead use
mdast-util-gfm-task-list-item
with
mdast.
Install
npm:
npm install micromark-extension-gfm-task-list-item
API
html
syntax
Note: syntax
is the default export of this module, html
is available at
micromark-extension-gfm-task-list-item/html
.
Support task list items.
The exports are extensions for the micromark parser (to tokenize checks; can be
passed in extensions
) and the default HTML compiler (to compile as <input>
elements; can be passed in htmlExtensions
).
Related
Contribute
See contributing.md
in micromark/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct.
By interacting with this repository, organization, or community you agree to
abide by its terms.
License
MIT © Titus Wormer