Socket
Socket
Sign inDemoInstall

micromark-extension-mdxjs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-mdxjs

micromark extension to support MDX.js


Version published
Weekly downloads
1.6M
increased by1.34%
Maintainers
1
Weekly downloads
 
Created

What is micromark-extension-mdxjs?

The micromark-extension-mdxjs package is an extension for the micromark Markdown parser that enables MDX.js syntax. This allows embedding JSX components directly within Markdown content, making it particularly useful for developers working with React in Markdown-driven sites or applications.

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

MDX Parsing

This feature allows the parsing of MDX content within Markdown files. The code sample demonstrates how to convert MDX syntax embedded in Markdown into HTML by using the micromark parser with the mdxjs extension.

import {micromark} from 'micromark';
import {mdxjs} from 'micromark-extension-mdxjs';

const markdown = '<MyComponent>Hello world!</MyComponent>';

const html = micromark(markdown, {
extensions: [mdxjs()]
});

console.log(html);

JSX Component Support

This feature supports the use of JSX components within Markdown. The code sample shows how to parse Markdown that includes a JSX component with props, converting it into HTML.

import {micromark} from 'micromark';
import {mdxjs} from 'micromark-extension-mdxjs';

const markdown = '<MyComponent prop1={value1}>More content here</MyComponent>';

const html = micromark(markdown, {
extensions: [mdxjs()]
});

console.log(html);

Other packages similar to micromark-extension-mdxjs

Keywords

FAQs

Package last updated on 19 Oct 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