Unify tables and listings

This commit is contained in:
2026-05-27 20:09:52 +02:00
parent e089e0b2c3
commit 20a6bac3d6
5 changed files with 91 additions and 76 deletions
+5 -1
View File
@@ -71,7 +71,11 @@ func renderMarkdown(raw []byte) template.HTML {
if err := md.Convert(raw, &buf); err != nil {
return ""
}
return template.HTML(rewriteTaskCheckboxes(buf.Bytes()))
out := rewriteTaskCheckboxes(buf.Bytes())
// Goldmark emits a bare `<table>`; tag it so it picks up the shared
// .data-table styling with the grid modifier (per-cell borders + header).
out = bytes.ReplaceAll(out, []byte("<table>"), []byte(`<table class="data-table data-table-grid">`))
return template.HTML(out)
}
// extractFirstHeading returns the text of the first ATX heading in raw markdown,