Socket
Socket
Sign inDemoInstall

remark-rehype

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-rehype

remark plugin that turns markdown into HTML to support rehype


Version published
Weekly downloads
4.2M
increased by8.75%
Maintainers
2
Weekly downloads
 
Created

What is remark-rehype?

The remark-rehype npm package is a plugin that transforms Markdown (.md) files into HTML. It is part of the unified ecosystem and is commonly used to integrate with other unified plugins to process and manipulate content.

What are remark-rehype's main functionalities?

Markdown to HTML conversion

This feature allows you to convert Markdown content into HTML. The code sample demonstrates how to set up a unified processor that parses Markdown, converts it to HTML using remark-rehype, and then serializes it to a string.

const unified = require('unified');
const markdown = require('remark-parse');
const remark2rehype = require('remark-rehype');
const html = require('rehype-stringify');

unified()
  .use(markdown)
  .use(remark2rehype)
  .use(html)
  .process('# Hello world!', function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Integration with unified ecosystem

remark-rehype can be used in conjunction with other plugins in the unified ecosystem, such as rehype-format for formatting the resulting HTML. The code sample shows how to include the rehype-format plugin in the processing pipeline.

const unified = require('unified');
const markdown = require('remark-parse');
const remark2rehype = require('remark-rehype');
const rehypeFormat = require('rehype-format');
const html = require('rehype-stringify');

unified()
  .use(markdown)
  .use(remark2rehype)
  .use(rehypeFormat)
  .use(html)
  .process('# Hello world!', function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Other packages similar to remark-rehype

Keywords

FAQs

Package last updated on 03 Dec 2021

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