askonomm / htmt

A templating library with native AOT support for .NET projects.
9 stars 0 forks source link

Automatically close HTML self-closing tags #9

Closed askonomm closed 1 month ago

askonomm commented 1 month 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 1 month ago

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