Markdown to Lexical icon

Markdown to Lexical

Converts Markdown to Lexical

Overview

This node converts Markdown text into Lexical format, a rich text editor data structure. It is useful when you want to transform Markdown content into a structured format suitable for further processing or integration with systems that use the Lexical editor framework. For example, you might use this node to prepare Markdown notes for storage in a database that supports Lexical or to convert user input from Markdown to a format compatible with a Lexical-based editor.

Properties

Name Meaning
Markdown The Markdown text to convert. Supports multiline input.

Output

The node outputs the original input data with an additional field added to each item's JSON under the key lexical. This field contains the converted Lexical representation of the provided Markdown string.

Example output JSON structure per item:

{
  "json": {
    // original input fields...
    "lexical": { /* Lexical formatted content derived from Markdown */ }
  }
}

No binary data output is produced by this node.

Dependencies

  • Requires the utility function convertMarkdownToLexical from an internal module to perform the conversion.
  • No external API keys or services are needed.
  • No special environment variables or n8n credentials are required.

Troubleshooting

  • Empty or invalid Markdown input: If the Markdown property is empty or malformed, the conversion may fail or produce unexpected results. Ensure valid Markdown is provided.
  • Conversion errors: If the conversion function throws an error, the node will either stop execution or continue based on the "Continue On Fail" setting. Errors include invalid Markdown syntax or unexpected input types.
  • Error messages: Errors thrown during conversion include context about the item index to help identify which input caused the failure.
  • To resolve issues, verify the Markdown input and check if the utility function supports all Markdown features used.

Links and References

Discussion