🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

mdast-util-gfm

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-gfm

mdast extension to parse and serialize GFM (GitHub Flavored Markdown)

3.1.0
latest
Source
npm
Version published
Weekly downloads
5.7M
-0.1%
Maintainers
2
Weekly downloads
 
Created

What is mdast-util-gfm?

The `mdast-util-gfm` package is a utility for working with GitHub Flavored Markdown (GFM) in the MDAST (Markdown Abstract Syntax Tree) format. It provides functions to parse and transform GFM-specific syntax such as tables, strikethroughs, task lists, and autolinks.

What are mdast-util-gfm's main functionalities?

Tables

This feature allows you to parse and transform GitHub Flavored Markdown tables into an MDAST tree structure.

const { fromMarkdown, toMarkdown } = require('mdast-util-gfm');
const markdown = '| Header1 | Header2 |
| ------- | ------- |
| Cell1   | Cell2   |';
const tree = fromMarkdown(markdown);
console.log(tree);

Strikethrough

This feature allows you to parse and transform strikethrough text in GitHub Flavored Markdown into an MDAST tree structure.

const { fromMarkdown, toMarkdown } = require('mdast-util-gfm');
const markdown = 'This is ~~strikethrough~~ text.';
const tree = fromMarkdown(markdown);
console.log(tree);

Task Lists

This feature allows you to parse and transform task lists in GitHub Flavored Markdown into an MDAST tree structure.

const { fromMarkdown, toMarkdown } = require('mdast-util-gfm');
const markdown = '- [x] Task 1
- [ ] Task 2';
const tree = fromMarkdown(markdown);
console.log(tree);

Autolinks

This feature allows you to parse and transform autolinks in GitHub Flavored Markdown into an MDAST tree structure.

const { fromMarkdown, toMarkdown } = require('mdast-util-gfm');
const markdown = 'Visit https://example.com for more info.';
const tree = fromMarkdown(markdown);
console.log(tree);

Other packages similar to mdast-util-gfm

Keywords

autolink

FAQs

Package last updated on 10 Feb 2025

Did you know?

Socket

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.

Install

Related posts