samg/diffy — pull request #37 by bricker (2014-02-26 08:16:20+00:00)
Title: Don't use DIV tag for empty diff in HTML format

With the [controversy and confusion](http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5) surrounding self-closing tags in HTML5, I think it's better not to leave this up to chance. In Chrome OS X 33.0.1750.117, the self-closing DIV tag generated for an empty diff renders as if the div never gets closed. It works fine in Safari 7.0.1 and Firefox 27.0.1, but it is still inconsistent.

According to the [HTML5 Specification](http://dev.w3.org/html5/spec-author-view/syntax.html#syntax-start-tag), a self-closing "normal tag" (such as DIV) is invalid. The specification for a start tag states:

> Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.

For "normal" elements (DIV), this specification would fail with the current behavior.

Thanks!