turndown
An open-source HTML-to-Markdown conversion library that supports custom conversion rules and filters through addRule, and is commonly used in content-cleaning pipelines.
Timeline (last 90 days)
turndown is a JavaScript library that converts HTML to Markdown, driven internally by rules composed of filters and replacements.
In turndown, using remove() to delete junk nodes may fail because the built-in paragraph rule matches and converts the node first; instead, addRule should be used to define a custom rule that returns an empty string to discard the node.
Each Substack image is wrapped in <a class="image-link">, which after conversion forms a nested [](img) pattern, requiring a custom rule to strip off the link layer.
All Facts (3)
turndown is a JavaScript library that converts HTML to Markdown, driven internally by rules composed of filters and replacements.
50%UnverifiedIn turndown, using remove() to delete junk nodes may fail because the built-in paragraph rule matches and converts the node first; instead, addRule should be used to define a custom rule that returns an empty string to discard the node.
50%UnverifiedEach Substack image is wrapped in <a class="image-link">, which after conversion forms a nested [](img) pattern, requiring a custom rule to strip off the link layer.
50%