Convert HTML into Markdown with JavaScript. to-markdown has been renamed to Turndown. See the migration guide for details. For usage with RequireJS, UMD versions are located in lib/turndown.umd.js (for Node.js) and lib/turndown.browser.umd.js for browser usage. These files are generated when the npm package is published. To generate them manually, clone this repo and run npm run build. Turndown also accepts DOM nodes as input (either element nodes, document nodes, or document fragment nodes). Options can be passed in to the constructor on instantiation. The key parameter is a unique name for the rule for easy reference. By default, Turndown does not keep any elements. The filter parameter works like a rule filter. To keep elements that are normally handled by rules, add a rule with the desired behaviour.

Features

  • Turndown can be extended by adding rules
  • The filter property determines whether or not an element should be replaced
  • The filter can be a function that returns a boolean depending on whether a given node should be replaced
  • The replacement function determines how an element should be converted
  • Blank rule determines how to handle blank elements
  • Keep rules determine how to handle the elements that should not be converted
  • Remove rules determine which elements to remove altogether

Project Samples

Project Activity

See All Activity >

Categories

HTML/XHTML

License

MIT License

Follow Turndown

Turndown Web Site

Other Useful Business Software
AI-generated apps that pass security review Icon
AI-generated apps that pass security review

Stop waiting on engineering. Build production-ready internal tools with AI—on your company data, in your cloud.

Retool lets you generate dashboards, admin panels, and workflows directly on your data. Type something like “Build me a revenue dashboard on my Stripe data” and get a working app with security, permissions, and compliance built in from day one. Whether on our cloud or self-hosted, create the internal software your team needs without compromising enterprise standards or control.
Try Retool free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Turndown!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript HTML XHTML

Registered

2021-09-28