Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Node Wrapper for HTML Tidy
JavaScript
tag: v0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
test
.gitignore
README.md
htmltidy.js
package.json

README.md

HTML Tidy

Node Wrapper for HTML Tidy

What is HTML Tidy?

HTML Tidy is an open source program for checking and generating clean XHTML/HTML. It cleans up coding errors in HTML files and fixes bad formatting. It can output files in the HTML, XHTML or XML file format.

Using HTML Tidy, developers can programatically clean up and fix poorly-written HTML pages. Another use is to convert HTML to XHTML or XML. These files can then be easily processed using the tools in the traditional XML chain, such as XSL transforms.

Installation

To use this library simply install it using npm:

npm install htmltidy

Example

var tidy = require('htmltidy').tidy;
tidy('<table><tr><td>badly formatted html</tr>', function(err, html) { 
    console.log(html); 
});

API

htmltidy.tidy(text, [options], callback)

Tidy html like text according optional configuration options.

var opts = {
    'doctype':'html5',
    'tidy-mark':false,
    'indent':true
}

Platform support

  • Linux
  • Windows 32/64

Credits

Something went wrong with that request. Please try again.