Socket
Socket
Sign inDemoInstall

micromark-extension-mdx-jsx

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-mdx-jsx

micromark extension to support MDX or MDX.js JSX


Version published
Weekly downloads
1.7M
increased by9.18%
Maintainers
1
Weekly downloads
 
Created

What is micromark-extension-mdx-jsx?

The micromark-extension-mdx-jsx package is an extension for micromark that enables parsing and compiling MDX JSX syntax. It allows you to use JSX components within your Markdown files, making it easier to integrate React components and other JSX-based elements into your Markdown content.

What are micromark-extension-mdx-jsx's main functionalities?

JSX Component Parsing

This feature allows you to parse JSX components within your Markdown content. The code sample demonstrates how to use the micromark-extension-mdx-jsx package to parse a simple JSX component and convert it to HTML.

const micromark = require('micromark');
const mdxJsx = require('micromark-extension-mdx-jsx');

const markdown = '<MyComponent prop="value" />';
const html = micromark(markdown, { extensions: [mdxJsx()] });
console.log(html);

Attribute Handling

This feature allows you to handle various types of attributes within JSX components in your Markdown. The code sample shows how to parse a JSX component with multiple attributes, including string and numeric values.

const micromark = require('micromark');
const mdxJsx = require('micromark-extension-mdx-jsx');

const markdown = '<MyComponent prop1="value1" prop2={2} />';
const html = micromark(markdown, { extensions: [mdxJsx()] });
console.log(html);

Nested JSX Components

This feature supports nested JSX components within your Markdown content. The code sample demonstrates how to parse a parent component containing a nested child component.

const micromark = require('micromark');
const mdxJsx = require('micromark-extension-mdx-jsx');

const markdown = '<ParentComponent><ChildComponent /></ParentComponent>';
const html = micromark(markdown, { extensions: [mdxJsx()] });
console.log(html);

Other packages similar to micromark-extension-mdx-jsx

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