markdown icon indicating copy to clipboard operation
markdown copied to clipboard

Skipped rendering of Markdown codefences and Markdown tables contained in HTML table cells

Open ufukty opened this issue 5 months ago • 0 comments

Reproduce

Input

<table>
<thead>
<tr>
<td>Input</td>
<td>Path examples</td>
</tr>
</thead>
<tbody>
<tr>
<td>

```yaml
students:
  alice:
    fullname: Alice Gamma
    classes:
      math:
        scores: [100, 100]
  bob:
    fullname: Bob Delta
    classes:
      math:
        scores: [100, 100]
      biology:
        scores: [100, 100]
employees:
  charlie:
    fullname: Charlie Epsilon
    DoE: 01.01.2024
```

</td>
<td>

| Path                 | List of matches                                                                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `students.alice`     | `students.alice`                                                                                                           |
| `employees.charlie`  | `employees.charlie`                                                                                                        |
|                      |                                                                                                                            |
| `*`                  | `students`, `employees`                                                                                                    |
| `*.charlie`          | `employees.charlie`                                                                                                        |
| `students.*`         | `students.alice`, `students.bob`                                                                                           |
|                      |                                                                                                                            |
| `**`                 | `students`, `students.alice`, ..., <br>`students.alice.classes.math.scores.[]`,<br>... `employees`, ... (total 20 matches) |
| `**.alice`           | `students.alice`                                                                                                           |
| `students.**.scores` | `students.alice.classes.math.scores`,<br>`students.bob.classes.math.scores`                                                |
| `students.**`        | `students.alice`, ...,<br>`students.bob.classes.biology.scores.[]`<br>(total 15 matches)                                   |

</td>
</tr>
</tbody>
</table>

Output

gomarkdown output is same with the textual content of input. Rendered as:

Image

Whereas Github renders it as:

Image

The input is from this project

Significance

Markdown content within HTML tables are commonly used in popular open source software docs as they are the most compact way of presenting the matching output for input of a software. As the markdown tables don't allow nesting, writers often required to use HTML tables for achieving the layout.

One solution

Change Gomarkdown renderer to span new rendering process for the content of a ranges enclosed by selected HTML tags eg. (<td>, </td>).

ufukty avatar Jul 31 '25 06:07 ufukty