tc39 / ecmarkup

An HTML superset/Markdown subset source format for ECMAScript and related specifications
https://tc39.es/ecmarkup/
MIT License
222 stars 63 forks source link

Odd emu-format behaviour with <dt> in table #618

Open ptomato opened 2 months ago

ptomato commented 2 months ago

Test case:

<emu-table id="table-foo">
  <table class="real-table">
    <thead>
      <tr>
        <th>Foo</th>
      </tr>
    </thead>
    <tr>
      <dt>Bar</dt> <!---------- note the accidental substitution of dt for td -->
    </tr>
  </table>
</emu-table>

emu-format makes this into

<!DOCTYPE html>
<emu-table id="table-foo">
  <dt>Bar</dt> <!----------------- note the insertion of this extra dt element -->
  <table class="real-table">
    <thead>
      <tr>
        <th>Foo</th>
      </tr>
    </thead>
    <tr>
      <dt>Bar</dt>
    </tr>
  </table>
</emu-table>

Of course, garbage in, garbage out, but this might be a symptom of a correct table getting mangled in some circumstances. Feel free to close if not.