ryansolid / dom-expressions

A Fine-Grained Runtime for Performant DOM Rendering
MIT License
858 stars 125 forks source link

Additional HTML closing tag omission #241

Open intrnl opened 1 year ago

intrnl commented 1 year ago

Following this part of the HTML specification, https://html.spec.whatwg.org/multipage/syntax.html#optional-tags

We should be able to minify this HTML code

<table>
  <thead>
    <tr>
      <td>Hello</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>World</td>
    </tr>
  </tbody>
<table>

to this

<table><thead><tr><td>Hello<tbody><tr><td>World</table>

This results a worthy size reduction for apps that render static tables, or display static CJK text with annotations (<ruby> tag, which has <rp> and <rt>)

ryansolid commented 1 year ago

I we did this optimization I just turned it off by default now and it under a config flag since some environments can't handle it. Like some testing environments completely choke on it.