Skip to content

Issue with empty table cell (<td></td>) using ConverterExtra #15

@francoisjacquet

Description

@francoisjacquet

Hi and thank you for this great Markdown converter!

Here is how to reproduce the issue (please note the empty <td></td>):

$converter_extra = new Markdownify\ConverterExtra;

echo $converter_extra->parseString('<table>
<thead>
<tr>
  <th>First Header</th>
  <th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
  <td>Content Cell</td>
  <td>Content Cell</td>
</tr>
<tr>
  <td></td>
  <td>Content Cell</td>
</tr>
</tbody>
</table>');

The above PHP code outputs that same HTML table.

Expected output:

| First Header | Second Header |
| ------------ | ------------- |
| Content Cell | Content Cell |
|              | Content Cell |

Please note that adding a space (<td> </td>) fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions