I am trying to display a table with some data spanning columns, and I think I have stumbled upon a bug.
Am I doing something wrong?
In a content file (foo.md) I have a table defined as such [note discourse is displaying slashes, but they are indeed vertical pipes]:
|Heading A|Heading B|Heading C|Heading D|Heading E|
|---|---|---|---|---|
|<td colspan="3">First|Next|
Expected:
A table row with “First” bridging columns 1-3, and Next appearing in column 4.
Received:
A table row with “First” bridging columns 2-4, and Next appearing in column 5.
Heading A | Heading B | Heading C | Heading D | Heading E | |
---|---|---|---|---|---|
First | Next |
<table>
<thead>
<tr>
<th>Heading A</th>
<th>Heading B</th>
<th>Heading C</th>
<th>Heading D</th>
<th>Heading E</th>
</tr>
</thead>
<tbody>
<tr>
<td></td><td colspan="3">First</td>
<td>Next</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
Analysis:
It appears somewhere in the rendering of the Goldmark table, something is broken. The use of the <td colspan>
appears to close the current td
element before it is implemented, resulting in a table that is always skewed one column to the right.
Unfortunately, I do not have the means to track the bug down to determine whether it is Hugo, Go, the Goldmark table extension, whatever…
Ideas? Or is this indeed a bug?
Environment
hugo env:
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended windows/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.20.1"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"
and in case it matters, my config.toml contains:
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true