Skip to content

[Bug]: <br> inside a <th> or a <td> trips the Table plugin (version 2.5.0) #204

@sergionalin

Description

@sergionalin

Describe the bug

The problem is with this snippet:

<th>Traveled distance<br>
          (km)</th>

If I remove html<br> from inside html<th> the table is rendered correctly.

The same problem happens if the html<br> is inside a html<td> element.

HTML Input

<html>
<head>
</head>
<body>
  <table border="1px solid black;" style="padding:0px; border-spacing:0px; border-collapse:collapse">
    <tbody>
      <tr>
        <th>Route</th>
        <th>Start load</th>
        <th>Back to depot</th>
        <th>Working hours</th>
        <th>Traveled distance<br>
        (km)</th>
        <th>Service attempts</th>
        <th>Total load<br>
        (kg)</th>
        <th>Bay</th>
        <th>Driver</th>
        <th>Vehicle type</th>
        <th>Special Area</th>
      </tr>
      <tr>
        <td align="center">1234</td>
        <td align="center">15:30</td>
        <td align="center">17:24</td>
        <td align="center">01:54</td>
        <td align="center">87,88</td>
        <td align="center">1</td>
        <td align="center">75</td>
        <td align="center">01</td>
        <td align="center">xxx</td>
        <td align="center">xxx</td>
        <td align="center">xxx</td>
      </tr>
    </tbody>
  </table>
</body>
</html>

Generated Markdown

Route Start load Back to depot Working hours Traveled distance  
(km) Service attempts Total load  
(kg) Bay Driver Vehicle type Special Area 

1234 15:30 17:24 01:54 87,88 1 75 01 xxx xxx xxx

Expected Markdown

| Route | Start load | Back to depot | Working hours | Traveled distance (km) | Service attempts | Total load (kg) | Bay | Driver | Vehicle type | Special Area |
|-------|------------|---------------|---------------|------------------------|------------------|-----------------|-----|--------|--------------|--------------|
| 1234  | 15:30      | 17:24         | 01:54         | 87,88                  | 1                | 75              | 01  | xxx    | xxx          | xxx          |

What plugins did you use?

other plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2version v2.x.x

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions