1N50MN14/html-element — pull request #11 by mmckegg (2013-10-14 04:59:53+00:00)
Title: Basic support for dataset, hacky set innerHTML, better html escaping, whitespace preservation

Added dataset support so that data-attributes render to outerHTML when using hyperscript. /cc @dominictarr

Made it so if innerHTML is set explicitly, it won't actually parse, but it will regurgitate it. Makes it so parts of the rendered html can be specified directly in HTML (e.g. for a markdown formatter)

Attribute escaping was a little wonky - single quote was getting escaped as double quote. There was actually no need to escape quotes for textContent, so I removed this. But html attributes were not being escaped at all and these do need to escape the double quote, so I fixed this.

The module adds a newline after every element, but this screws with whitespace especially for inline elements where whitespace actually shows as a space in the browser. I've patched it to not add the extra whitespace, instead just using the specified.

Plus some tests to prove it works!

A lot of these issues I have encountered while working on [rincewind](https://github.com/mmckegg/rincewind), my HTML templating engine which uses hyperscript.

Hopefully these changes are all okay with you :)