I have a simple shortcode:
<div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}table{{ end }}">
{{- .Inner -}}
</div>
It’s used to wrap a markdown-formatted table in a simple div, so it’s used like this in an actual post.md file:
{{% table %}}
| Column should align left | Column should align center | Column should align right |
|:----------- |:-------------:| ------------:|
| align: left | align: center | align: right |
| align: left | align: center | align: right |
| align: left | align: center | align: right |
{{% /table %}}
Previously it would render as:
<div class="table">
<table>
<thead>
<tr>
<th align="left">Column should align left</th>
<th align="center">Column should align center</th>
<th align="right">Column should align right</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">align: left</td>
<td align="center">align: center</td>
<td align="right">align: right</td>
</tr>
<tr>
<td align="left">align: left</td>
<td align="center">align: center</td>
<td align="right">align: right</td>
</tr>
<tr>
<td align="left">align: left</td>
<td align="center">align: center</td>
<td align="right">align: right</td>
</tr>
</tbody>
</table>
</div>
However installing 0.55.3 today broke rendering, and I end up with this:
<div class="table">
| Column should align left | Column should align center | Column should align right |
|:----------- || ------------:|
| align: left | align: center | align: right |
| align: left | align: center | align: right |
| align: left | align: center | align: right |
</div>
Of course I tried the fix listed on in the release notes, so I prepended the “old behavior” line to my shortcode template:
{{ $_hugo_config := `{ "version": 1 }` }}
<div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}table{{ end }}">
{{- .Inner -}}
</div>
However now all I get is this:
<div class="table"><p>| Column should align left | Column should align center | Column should align right |
|:———– || ————:|
| align: left | align: center | align: right |
| align: left | align: center | align: right |
| align: left | align: center | align: right |</p>
</div>
I have tried the latest v0.56.0-DEV build and got exactly the same results. I have also tried every conceivable variant on changing from {{% to {{< form and using markdownify
, to no avail.
As I can’t find an obvious way in which the new default benefits me I’m a bit stymied.
Anyone see a fix?