klacke/yaws — pull request #182 by weisslj (2014-08-20 14:12:14+00:00)
Title: yaws_api: Make end tags HTML5-compatible in ehtml_expand

Currently, HTML generated by Yaws ehtml does not validate correctly as
HTML5 (e.g. using http://validator.w3.org/). The reason is that in HTML5
"void elements" like `
` must not have a closing end tag:

Forbidden: `
`
Allowed: `
`
Allowed (and also valid XHTML): `
`

Also, since the self-closing tag syntax ("/>") is simply ignored in
HTML5, some elements must have an end tag:

Forbidden: `

`
Allowed:`

`

This patch fixes both issues and also adds tests.

References:
- http://stackoverflow.com/questions/10598501/closing-tags-in-html5
- http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br
- http://www.w3.org/TR/html-markup/syntax.html#void-element