chalk icon indicating copy to clipboard operation
chalk copied to clipboard

`chalk docgen` renders HTML tables incorrectly

Open ee7 opened this issue 2 years ago • 0 comments

Steps to reproduce

Run chalk docgen with chalk 0.3.1 or b8a69436a25b2c9cb50f50ce64e4b02cb683eb64.

Expected behavior

HTML tables are rendered correctly, like:

<table>
  <tbody>
    <tr>
      <th>Command Name</th>
      <th>Description</th>
    </tr>
    <tr>
      <td>insert</td>
      <td>Add chalk marks to artifacts</td>
    </tr>
    <!-- skipping some rows -->
    <tr>
      <td>docgen</td>
      <td>Generate technical documentation</td>
    </tr>
  </tbody>
</table>

Observed behavior

HTML tables are rendered incorrectly, with:

  • an extra <td> and </td> around every cell
  • no <tr> or </tr> anywhere
  • <caption> at the bottom, where it is invalid (it must be the first child of <table>)

like:

<table>
  <tbody>
    <td>
      <th>Command Name</th>
    </td>
    <td>
      <th>Description</th>
    </td>
    <td>
      <td>insert</td>
    </td>
    <td>
      <td>Add chalk marks to artifacts</td>
    </td>
    <!-- skipping some "rows" -->
    <td>
      <td>docgen</td>
    </td>
    <td>
      <td>Generate technical documentation</td>
    </td>
  </tbody>
<caption>
</caption>
</table>

This is blocking https://github.com/crashappsec/marketing-site/pull/192.

Discussion

It looks the bug is in nimutils rope_htmlrender.nim here.

I believe this is independent of https://github.com/crashappsec/chalk/issues/167.

ee7 avatar Jan 30 '24 11:01 ee7