askonomm / htmt

A templating language with native AOT support for .NET projects.
5 stars 0 forks source link

Automatically close HTML self-closing tags #9

Closed askonomm closed 2 days ago

askonomm commented 5 days ago

To eliminate the problem of HTML self-closing tags not working in Htmt, I think it makes sense to add a interceptor between before the XML gets parsed that will find self-closing tags and closes them automatically.

E.g:

<img src="image.jpeg">

would then become:

<img src="image.jpeg" />
askonomm commented 5 days ago

They are called void elements: https://html.spec.whatwg.org/multipage/syntax.html#void-elements