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
Enterprise-grade ITSM, for every business Icon
Enterprise-grade ITSM, for every business

Give your IT, operations, and business teams the ability to deliver exceptional services—without the complexity.

Freshservice is an intuitive, AI-powered platform that helps IT, operations, and business teams deliver exceptional service without the usual complexity. Automate repetitive tasks, resolve issues faster, and provide seamless support across the organization. From managing incidents and assets to driving smarter decisions, Freshservice makes it easy to stay efficient and scale with confidence.
Try it 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