Data Converter icon

Data Converter

Convert between various data formats - Base64, Binary, JSON, XML, YAML, CSV, HTML, and more

Overview

This node converts data from HTML format to Markdown format. It is useful when you have HTML content and want to transform it into Markdown syntax, which is simpler and widely used for documentation, notes, and content management systems.

Common scenarios include:

  • Converting rich HTML email content into Markdown for easier editing or storage.
  • Transforming HTML snippets from web scraping into Markdown for use in static site generators or markdown-based editors.
  • Simplifying HTML content for platforms that support Markdown but not full HTML.

Example: You input an HTML string like <h1>Title</h1><p>This is a paragraph.</p> and the node outputs the equivalent Markdown:

# Title

This is a paragraph.

Properties

Name Meaning
Input Data The HTML content string to convert to Markdown.
Binary Property Name (Optional) If outputting binary data, this is the name of the binary property to use.

Output

The node outputs a JSON object with a result field containing the converted Markdown string.

Example output JSON structure:

{
  "result": "# Title\n\nThis is a paragraph."
}

If configured to output binary data (not typical for this operation), the binary data will be available under the specified binary property name.

Dependencies

  • No external API keys or services are required.
  • The conversion uses internal utility functions bundled with the node implementation.
  • No special environment variables or n8n configurations are needed.

Troubleshooting

  • Empty or invalid HTML input: If the input HTML is empty or malformed, the output Markdown may be empty or incorrect. Ensure valid HTML is provided.
  • Unsupported HTML features: Complex HTML elements or styles might not convert perfectly to Markdown due to Markdown's simpler syntax.
  • Error messages: If an error occurs during conversion, the node will throw an error indicating the issue. Common fixes include validating the input HTML or checking for unsupported tags.

Links and References

Discussion