tautologistics/node-htmlparser — pull request #54 by jankuca (2012-08-16 21:18:35+00:00)
Title: V1.x

Hi,

there are several situations in which you can omit closing tags of some elements.

```html

First paragraph.

Second paragraph.
```

This is valid HTML5 code and should be parsed as

```html

First paragraph.

Second paragraph.

```

The parser instead nests the second paragraph into the former one as

```html

First paragraph.

Second paragraph.

```

I tweaked the 1.x version of the parser. It should now correctly add closing tags when they are intentionally omitted.

The rules are in the `closingOpeningTags` map. There are lists of tags that close each of the elements that have ommitable closing tags.

For the HTML code above, the actual result is

```html

First paragraph.

Second paragraph.

```

(which is totally correct).

I hope you can include this in the codebase. Cheers!