ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
887 stars 127 forks source link

th as a child of a component results in `The HTML provided is malformed` #358

Open katywings opened 1 month ago

katywings commented 1 month ago

Is

Rendering a <th> in a <Show>, <For> or basically any component results in "The HTML provided is malformed and will yield unexpected output when evaluated by a browser." warnings.

<Show when={true}>
  <th class="one"></th>
</Show>
<Parent>
  <th class="two"></th>
</Parent>

Should

This should not result in a warning.

Repro

https://stackblitz.com/edit/github-wixnng?file=src%2Froutes%2Findex.tsx (check the Terminal)

Refs

350

titoBouzout commented 1 month ago

@katywings I have just seen this! Yeah, validation for th was missing, my bad. There was also a need to cover the outer bits which I didn't consider, such empty table/thead/tbody.
I think all should be covered in https://github.com/ryansolid/dom-expressions/pull/360

katywings commented 1 month ago

@titoBouzout Haha all good :). I am looking forward to the PR, the warnings are a bit spammy during hmr development 😂

jorbuedo commented 3 weeks ago

@titoBouzout I think caption is missing as well.

titoBouzout commented 3 weeks ago

@titoBouzout I think caption is missing as well.

Thanks for the report! Its interesting I do not think I have ever used any of these tags, I have added caption and took the opportunity to refactor it a little https://github.com/ryansolid/dom-expressions/pull/376