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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start 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