Skip to content

Incorrect conversions for tables with row of different lengths #23

@EvitanRelta

Description

@EvitanRelta

Problem 1

Currently, this HTML:

<table>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Cell 1</td>
  </tr>
</table>


Throws an error:

image


The output markdown should be in HTML-syntax, the same as the above HTML.


Note: It should NOT be in markdown with missing cells like:

| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1   |


As the above markdown renders as:

Header 1 Header 2
Cell 1


When it's suppose to be:

Header 1 Header 2
Cell 1

Problem 2

Currently, this HTML:

<table>
  <tr>
    <th>Header 1</th>
  </tr>
  <tr>
    <td>Cell 1</td>
    <td>Cell 2</td>
  </tr>
</table>


converts to this markdown:

| Header 1 |
|----------|
| Cell 1   | Cell 2 |


which incorrectly renders in GitHub as:

Header 1
Cell 1


The output markdown should be in HTML-syntax, the same as the above HTML.


Note: It should NOT be in markdown with empty headers:

| Header 1 |        |
| -------- | ------ |
| Cell 1   | Cell 2 |


As the above markdown renders as:

Header 1
Cell 1 Cell 2


When it's suppose to be:

Header 1
Cell 1 Cell 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions