Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
micromark-extension-gfm-task-list-item
Advanced tools
micromark extension to support GFM task list items
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.
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);
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 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 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 to support GitHub flavored markdown (GFM) task list items. This extension matches the GFM spec for the few things it defines and otherwise matches github.com.
You should probably use micromark-extension-gfm
instead, which combines this package with other GFM features.
Alternatively, if you don’t want all of GFM, use this package.
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
npm install micromark-extension-gfm-task-list-item
import {micromark} from 'micromark'
import {
gfmTaskListItem,
gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'
const output = micromark('* [x] a\n* [ ] b', {
extensions: [gfmTaskListItem],
htmlExtensions: [gfmTaskListItemHtml]
})
console.log(output)
Yields:
<ul>
<li><input checked="" disabled="" type="checkbox"> a</li>
<li><input disabled="" type="checkbox"> b</li>
</ul>
This package exports the following identifiers: gfmTaskListItem
,
gfmTaskListItemHtml
.
There is no default export.
The export map supports the endorsed
development
condition.
Run node --conditions development module.js
to get instrumented dev code.
Without this condition, production code is loaded.
gfmTaskListItem
gfmTaskListItemHtml
Support task list items.
An extension for micromark to parse checks (can be passed in extensions
) and
one to compile as <input>
elements (can be passed in htmlExtensions
).
remarkjs/remark
— markdown processor powered by pluginsremarkjs/remark-gfm
— remark plugin using this and other GFM featuresmicromark/micromark
— the smallest commonmark-compliant markdown parser that existsmicromark/micromark-extension-gfm
— micromark extension combining this with other GFM featuressyntax-tree/mdast-util-gfm-task-list-item
— mdast utility to support task listssyntax-tree/mdast-util-gfm
— mdast utility to support GFMsyntax-tree/mdast-util-from-markdown
— mdast parser using micromark
to create mdast from markdownsyntax-tree/mdast-util-to-markdown
— mdast serializer to create markdown from mdastSee 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.
FAQs
micromark extension to support GFM task list items
The npm package micromark-extension-gfm-task-list-item receives a total of 2,198,098 weekly downloads. As such, micromark-extension-gfm-task-list-item popularity was classified as popular.
We found that micromark-extension-gfm-task-list-item demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.