MarkDown TurnDown icon

MarkDown TurnDown

Node to use in n8n that allows you to convert HTML to MarkDown using one of the most famous JS libraries that perform this conversion to Turndown | PT-BR: Nó para usar em n8n que permite converter HTML para MarkDown usando uma das bibliotecas JS mais famosas que realizam essa conversão, Turndown

Overview

This node converts between HTML and Markdown formats. It supports two operations: converting HTML content into Markdown syntax, and converting Markdown text back into HTML. This is useful in scenarios where you need to transform web content or documentation between these two popular markup languages for easier editing, display, or storage.

Practical examples include:

  • Converting HTML emails or web snippets into Markdown for use in markdown-based editors or platforms.
  • Transforming Markdown notes or documentation into HTML for rendering on websites or applications.

Properties

Name Meaning
Input The markup text to be transformed. Can be either HTML or Markdown depending on the operation.
Output Key The key name under which the converted output will be stored in the node's JSON output data.

Output

The node outputs an object with a JSON field containing the converted text under the specified output key. For example, if the output key is "data", the output JSON will have a property data holding the converted Markdown or HTML string.

No binary data output is produced by this node.

Dependencies

  • Uses the external JavaScript libraries:
    • turndown: Converts HTML to Markdown.
    • marked: Parses Markdown into HTML.

No special API keys or credentials are required. These dependencies are bundled within the node.

Troubleshooting

  • Unknown Operation Error: If an unsupported operation is selected, the node throws an error indicating the operation is not known. Ensure the operation is either "HTML > Markdown" or "Markdown > HTML".
  • Invalid Input Format: Providing input that does not match the expected format (e.g., invalid HTML or malformed Markdown) may result in unexpected output or errors. Validate your input before processing.
  • Continue On Fail Behavior: If enabled, the node will continue processing subsequent items even if one fails, appending error details to the output for failed items.

Links and References

Discussion