aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2024-09-28 12:06:09 -0700
committerBjørn Erik Pedersen <[email protected]>2024-09-30 08:44:14 +0200
commit1158e6307212fd3ff96f29db0baf79463e0c031e (patch)
treeae119f59d5fd8dbf89c4254165652512971ffd6a /tpl
parentd1ba52f3c3bdc31c2067f986fdb57088d875c01e (diff)
downloadhugo-1158e6307212fd3ff96f29db0baf79463e0c031e.tar.gz
hugo-1158e6307212fd3ff96f29db0baf79463e0c031e.zip
markup/goldmark: Change default cell alignment in table render hook
Change the default table cell alignment from "left" to an empty string. Closes #12886
Diffstat (limited to 'tpl')
-rw-r--r--tpl/tplimpl/embedded/templates/_default/_markup/render-table.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
index a0b0cc34d..5fdd79ddb 100644
--- a/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
+++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-table.html
@@ -8,7 +8,11 @@
{{- range .THead }}
<tr>
{{- range . }}
- <th {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
+ <th
+ {{- with .Alignment }}
+ {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
+ {{- end -}}
+ >
{{- .Text -}}
</th>
{{- end }}
@@ -19,7 +23,11 @@
{{- range .TBody }}
<tr>
{{- range . }}
- <td {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
+ <td
+ {{- with .Alignment }}
+ {{- printf " style=%q" (printf "text-align: %s" .) | safeHTMLAttr }}
+ {{- end -}}
+ >
{{- .Text -}}
</td>
{{- end }}