Overview
This node converts HTML content into Markdown format. It is useful when you have HTML input (e.g., from web scraping, emails, or rich text editors) and want to transform it into a simpler, plain-text Markdown representation for easier readability, storage, or further processing.
Practical examples include:
- Converting HTML email bodies into Markdown for use in documentation or notes.
- Transforming HTML content scraped from websites into Markdown for static site generators.
- Simplifying rich text editor output into Markdown for consistent formatting across platforms.
Properties
| Name | Meaning |
|---|---|
| HTML | The HTML string that you want to convert into Markdown. |
| Destination Key | The field path where the converted Markdown will be stored in the output JSON. Supports nested fields using dot notation (e.g., level1.level2.newKey). |
Output
The node outputs an array of JSON objects corresponding to each input item. Each output item contains all original data plus a new field at the specified destination key containing the Markdown-converted string.
Example output structure for one item if Destination Key is set to data:
{
"data": "## Converted Markdown content here"
}
If a nested destination key like level1.level2.markdown is used, the output would nest the Markdown string accordingly.
No binary data is produced by this node.
Dependencies
- Uses the external library turndown to perform the HTML to Markdown conversion.
- Uses lodash's
setfunction to assign the converted Markdown string to the specified nested field in the output JSON.
No external API keys or credentials are required.
Troubleshooting
- Empty or invalid HTML input: If the HTML string is empty or malformed, the output Markdown may be empty or incomplete. Ensure valid HTML is provided.
- Incorrect destination key path: If the destination key uses invalid syntax or conflicts with existing data types (e.g., trying to set a string on a path where an object exists), the node might throw errors or overwrite data unexpectedly. Use proper dot notation and verify the target path.
- Errors during conversion: If the turndown library encounters unexpected HTML structures, it might throw errors. Enabling "Continue On Fail" allows the workflow to proceed while logging the error message in the output.
Links and References
- Turndown GitHub Repository – Official library used for HTML to Markdown conversion.
- Markdown Guide – Reference for Markdown syntax.