New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@virtuoso.dev/lexical-mdx-import-export

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@virtuoso.dev/lexical-mdx-import-export

  • 0.0.6
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Lexical MDX

This project aims to develop a set of packages for editing of MDX in Lexical.

If you're using markdown with Lexical and you need help or would like to collaborate, contact me over the email in my profile or over Discord.

Markdown import/export

The markdown import/export utility supports extensible and configurable markdown interoperability with Lexical.

Unlike the built-in Lexical support, this implementation uses Markdown Abstract Syntax Tree with the mdx extension turned on. This allows support for html tags (like <u>underline</u>) and the editing and configuration of React components. It also supports configuration of the markdown output format.

Out of the box, the following syntax is supported:

  • Paragraphs
  • Bold, italic, underline formatting
  • Headings
  • Ordered and unordered lists
  • Nested lists
  • Links
  • Block quotes
  • Inline code and code blocks
  • Images
  • Horizontal rules

Basic usage

Check the live example with all markdown syntax supported first.

To add the package to your project, install it with

npm install --save @virtuoso.dev/lexical-mdx-import-export

Configure markdown export formatting

The exportMarkdownFromLexical method accepts an optional options parameter that controls the markdown formatting. Check the link above for detialed documentation from mdast.

Support additional nodes through visitors

Both the import and export are implemented with visitor objects. The functions accept an optional Array parameter of the visitors to be applied to the syntax tree.

You can take the default array of visitors exported as MdastVisitors and, LexicalVisitors and append your own custom visitors or replace the default ones.

The easiest way to create your own visitor is to use the code of a one that's similar to what you need and use it as a starting point.

Support

Contact me over the email in my profile or over Discord.

License

MIT License.

FAQs

Package last updated on 11 Feb 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