# breakdance **Repository Path**: lutaining/breakdance ## Basic Information - **Project Name**: breakdance - **Description**: html转markdown - **Primary Language**: JavaScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-01-26 - **Last Updated**: 2022-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # breakdance [](https://www.npmjs.com/package/breakdance) [](https://npmjs.org/package/breakdance) [](https://npmjs.org/package/breakdance) [](https://travis-ci.org/breakdance/breakdance) > Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy to use. It's time for your markup to get down. Breakdance is a node.js library for converting HTML to markdown. You can use breakdance to: * Migrate HTML blog posts to markdown * Convert wiki pages to markdown * Convert HTML documentation to markdown * Convert HTML presentations or slide decks to markdown * Convert busy web pages into readable markdown documents. Visit [breakdance.io](http://breakdance.io) for detailed documentation, [examples](http://breakdance.io/examples), [recipes](http://breakdance.io/recipes), and advice on [authoring and finding plugins](http://breakdance.io/plugins.html). ## Why should I use breakdance? Breakdance uses [cheerio](https://github.com/cheeriojs/cheerio) to parse HTML, and [snapdragon](https://github.com/jonschlinkert/snapdragon) for rendering, which provides granular control over the entire conversion process in a way that is easy to understand, reason about, and [customize](http://breakdance.io/plugins.html). If you see something you don't like, it's easy to change! **Generates well-formatted markdown** * Comprehensive [HTML tag coverage](lib/compiler.js). * Granular control over every HTML element and attributes * Even **converts HTML tables** to markdown! **Extremely pluggable** Every part of the conversion is customizable: * [options](http://breakdance.io/plugins.html) are available for customizing output of any HTML tag if you don't like the defaults * [plugins](http://breakdance.io/plugins.html) are easy to write if you'd like to share your customizations with the world ## HTML-to-markdown example **Tables** The following HTML table from [bootstrap's docs](https://github.com/twbs/bootstrap): ```html
Add .table-hover to enable a hover state on table rows within a <tbody>.
| # | First Name | Last Name | Username |
|---|---|---|---|
| 1 | Mark | Otto | @mdo |
| 2 | Jacob | Thornton | @fat |
| 3 | Larry | the Bird |
`: improvements to whitespace handling
* ``: no longer renders empty tags
* ``: normalize Unicode `U+00A0` non-breaking spaces to "normal" Unicode `U+0020` spaces. Non-breaking spaces are useful in HTML, but cause flow problems in markdown.
**Added**
* documentation for `options.comments`, `options.unsmarty`, `options.trailingWhitespace`, all previously undocumented options. See [breakdance.io/options](http://breakdance.io/docs.html#options)
##### [1.0.0](https://github.com/breakdance/breakdance/compare/0.1.5...1.0.0) - 2017-03-12
**Added**
* Adds support for ` `, closes [issue #3](https://github.com/breakdance/breakdance/issues/3)
**Changed**
* Changed the CLI command from `tomd` to either `br`. As a fallback, you can also use `breakdance` if there is a conflict. The CLI has not yet been documented, so hopefully this doesn't cause any issues for anyone.
##### [0.1.5](https://github.com/breakdance/breakdance/compare/0.1.4...0.1.5)
**Fixed**
* An extra trailing newline was being added on `` tags
**Added**
* Adds `keepEmpty` option, to selective keep empty tags that are omitted by built-in `omitEmpty` tags
* Adds documentation for `omit`, `pick` and `omitEmpty` and `keepEmpty` options
**Changed**
* Externalized `utils.js` to [breakdance-util](https://github.com/breakdance/breakdance-util), to allow plugin authors to use the same utilities as breakdance, for consistency.
##### [0.1.4](https://github.com/breakdance/breakdance/compare/0.1.0...0.1.4)
**Fixed**
* Better whitespace handling in `table`, `a` and `dl` tags
**Added**
* Adds documentation for `url` option
##### [0.1.0]
First release.
_(Changelog generated by [helper-changelog](https://github.com/helpers/helper-changelog))_
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on May 12, 2017._