What is micromark-extension-gfm-table?
The micromark-extension-gfm-table npm package is a plugin for the micromark Markdown parser that adds support for GitHub Flavored Markdown (GFM) tables. This extension allows developers to parse and render tables in Markdown text according to the GFM specification, which is particularly useful for projects that need to handle GitHub-style Markdown.
What are micromark-extension-gfm-table's main functionalities?
Parsing GFM tables
This feature allows the parsing of GitHub Flavored Markdown tables into HTML. The code sample demonstrates how to use the micromark parser with the gfm-table extension to convert a simple Markdown table into HTML.
const micromark = require('micromark');
const gfmTable = require('micromark-extension-gfm-table');
const markdown = '| Header 1 | Header 2 |\n| --------- | --------- |\n| Cell 1 | Cell 2 |';
const html = micromark(markdown, {
extensions: [gfmTable]
});
console.log(html);
Other packages similar to micromark-extension-gfm-table
markdown-it
markdown-it is a Markdown parser that can be extended with plugins, similar to micromark. It supports GFM tables through its own plugin system. Compared to micromark-extension-gfm-table, markdown-it provides a more comprehensive solution with additional plugins for various Markdown extensions, making it versatile but potentially heavier.
remark-gfm
remark-gfm is a plugin for the remark Markdown processor that adds support for GFM features, including tables. It is part of the unified collective and works in the ecosystem involving remark and rehype for processing Markdown and HTML respectively. Compared to micromark-extension-gfm-table, remark-gfm is typically used in a broader processing pipeline that can handle a wide range of transformations and outputs.
micromark-extension-gfm-table
micromark extension to support GitHub flavored markdown tables.
This syntax extension matches the GFM spec and 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-table
with
mdast.
Install
npm:
npm install micromark-extension-gfm-table
API
html
syntax
Note: syntax
is the default export of this module, html
is available at
micromark-extension-gfm-table/html
.
Support tables.
The exports are extensions for the micromark parser (to tokenize tables; can be
passed in extensions
) and the default HTML compiler (to compile as <table>
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