FB55/node-htmlparser — pull request #12 by siddMahen (2012-01-21 19:49:06+00:00)
Title: Cleaned up DomUtils

* Attempted to perform some optimization
* Fixed some style inconsistencies
* Added tests for DomUtils HTML methods

This fixes a few issues related to `getInnerHTML` and `getOuterHTML` and generally cleans up the file. All tests pass.

In case you want to check out some of the HTML method inconsistencies in the current version, try:

```javascript
var htmlparser2 = require("htmlparser2"),
DomUtils = htmlparser2.DomUtils;

var handler = new htmlparser2.DomHandler(),
parser = new htmlparser2.Parser(handler);

parser.parseComplete(' text ');

console.log(DomUtils.getOuterHTML(handler.dom[0]));
console.log(DomUtils.getInnerHTML(handler.dom[0]));
```
which yields the (improper) HTML:

```
> >
> >
```

With this pull, we get:

```
text
text
```