Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micromark-extension-gfm

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-gfm

micromark extension to support GFM (GitHub Flavored Markdown)

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is micromark-extension-gfm?

The micromark-extension-gfm npm package is an extension for the micromark Markdown parser that adds support for GitHub Flavored Markdown (GFM). This extension enables users to parse and render Markdown text according to the specifications of GFM, which includes several GitHub-specific features such as tables, task lists, and strikethrough.

What are micromark-extension-gfm's main functionalities?

Tables

This feature allows the parsing of tables in Markdown formatted text. The code sample demonstrates how to convert a simple Markdown table into HTML using the micromark parser with the gfmTable extension.

import {micromark} from 'micromark';
import {gfmTable} from '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);

Task Lists

This feature supports the rendering of task lists, where tasks can be marked as completed or incomplete. The code sample shows how to convert Markdown task list items into HTML.

import {micromark} from 'micromark';
import {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item';

const markdown = '- [x] Completed task\n- [ ] Incomplete task';
const html = micromark(markdown, {extensions: [gfmTaskListItem()]});
console.log(html);

Strikethrough

This feature enables the use of strikethrough text formatting in Markdown. The code sample illustrates how to parse and convert strikethrough text from Markdown to HTML.

import {micromark} from 'micromark';
import {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough';

const markdown = 'This is ~~strikethrough~~ text.';
const html = micromark(markdown, {extensions: [gfmStrikethrough()]});
console.log(html);

Other packages similar to micromark-extension-gfm

Keywords

FAQs

Package last updated on 26 Jun 2023

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