Skip to content

js-mk/turndown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turndown

Convert HTML into Markdown with JavaScript.

Note this is currently a work-in-progress to replace https://github.com/domchristie/to-markdown. It is pre-release software. API changes are likely.

Installation

npm:

npm install turndown

Browser:

<script src="https://unpkg.com/turndown/dist/turndown.js"></script>

Usage

// For Node.js
var TurndownService = require('turndown')

var turndownService = new TurndownService()
var markdown = turndownService.turndown('<h1>Hello world!</h1>')

Options

Options can be passed in to the constructor on instantiation.

Option Valid values Default
headingStyle setext or atx setext
hr Any Thematic break * * *
bulletListMarker -, +, or * *
codeBlockStyle indented or fenced indented
fence ``` or ~~~ ```
emDelimiter _ or * _
strongDelimiter ** or __ **
linkStyle inlined or referenced inlined
linkReferenceStyle full, collapsed, or shortcut full

License

turndown is copyright © 2017+ Dom Christie and released under the MIT license.

About

🛏 An HTML to Markdown converter written in JavaScript

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 51.3%
  • JavaScript 48.7%