tidy-html5
Version:
Tidy bad HTML markup
23 lines (15 loc) • 554 B
Markdown
Clean and format HTML markup.
Use `require("tidy-html5").tidy_html5(html_string, options)`.
```javascript
var tidy = require("tidy-html5").tidy_html5
var result = tidy("<h1>I <3 bad markup</h2>", {"indent-spaces": 4});
console.log(result);
```
Here is [the full list of options](http://w3c.github.io/tidy-html5/quickref.html).
This is just [tidy-html5](https://github.com/w3c/tidy-html5) compiled from C
to javascript using [emscripten](https://github.com/kripken/emscripten/).