Replace table shortcode with markdown attributes for class

This commit is contained in:
2024-11-15 17:25:46 -06:00
parent ddb57e0120
commit c9095e948b
3 changed files with 13 additions and 17 deletions

View File

@ -1,10 +0,0 @@
{{/* See https://willschenk.com/articles/2020/styling_tables_with_hugo/ */}}
{{ $class := "markdown" }}
{{ with .Get "class" }}
{{ $class = delimit (slice $class .) " " }}
{{ end }}
{{ $htmlTable := .Inner | .Page.RenderString (dict "display" "block") }}
{{ $new := printf `<table class="%s">` $class }}
{{ (replace $htmlTable "<table>" $new) | safeHTML }}