Socket
Socket
Sign inDemoInstall

mdast-util-gfm

Package Overview
Dependencies
Maintainers
1
Versions
8
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)


Version published
Weekly downloads
2.9M
decreased by-19.43%
Maintainers
1
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

FAQs

Package last updated on 18 Sep 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc