Stardown icon indicating copy to clipboard operation
Stardown copied to clipboard

Tables with captions in paragraphs need an empty line

Open wheelercj opened this issue 11 months ago • 0 comments

If a table with a caption is in a paragraph element, the table does not correctly convert from HTML to markdown because there is no empty line between the caption and the table in the result.

For example, the HTML below results in the markdown after it.

<p>
  <table>
    <caption>Here's a caption.</caption>
    <tr>
      <td>history</td>
      <td>absorption</td>
    </tr>
    <tr>
      <td>analyst</td>
      <td>retire</td>
    </tr>
  </table>
</p>
**Here's a caption.**
| history | absorption |
| --- | --- |
| analyst | retire |

Expected behavior There should be an empty line between the caption and the table so that markdown renderers will recognize the table as a table.

wheelercj avatar Nov 03 '24 00:11 wheelercj