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

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
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