turndown
Version:
A library that converts HTML to Markdown
33 lines (23 loc) • 1.09 kB
Markdown
# Turndown
Convert HTML into Markdown.
**Note this is pre-release software. API changes are likely.**
## Usage
```js
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](http://spec.commonmark.org/0.27/#thematic-breaks) | `* * *` |
| `bulletListMarker` | `-`, `+`, or `*` | `*` |
| `codeBlockStyle` | `indented` or `fenced` | `indented` |
| `fence` | <code>```</code> or `~~~` | <code>```</code> |
| `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.