Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Tags incorrectly made self-closing when compiled #29

hesselink opened this Issue · 1 comment

2 participants


Rendering the following template

<a href="${a}"></a>

produces this output:

<a href="${a}" />

According to the HTML5 spec, this means the same as

<a href="${a}">

This has a different meaning, and will break your HTML.

The reason this happens is that in Heist.Compiled.Internal.compileNode, a tag is 'self-closed' like this if it contains no children. This should only be done for tags that must be empty in HTML5, like br and img. In Text.XmlHtml.HTML.Meta, there is a set of voidTags that can be used to check if the tag should be self-closed. However, that module isn't exported (yet), which is why I couldn't easily send a pull request. Should I just expose the module and use that in heist? That's how I fixed it locally.


I just made a new hackage release of xmlhtml that exports the Meta module that has voidTags. So yes, I think Heist should use that to do the right thing.

@mightybyte mightybyte closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.