2019-04-10 05:20:12 +00:00
|
|
|
{{ $hasCaption := isset .Params "caption" }}
|
|
|
|
{{ $caption := .Get "caption" }}
|
2023-08-06 23:03:39 +00:00
|
|
|
{{ $sortable := .Get "sortable" }}
|
2019-04-10 05:20:12 +00:00
|
|
|
{{ $captionEl := printf "<table><caption style=\"display: none;\">%s</caption>" $caption }}
|
|
|
|
{{ $table := .Inner | markdownify }}
|
|
|
|
{{ $html := cond $hasCaption ($table | replaceRE "<table>" $captionEl) $table | safeHTML }}
|
2023-08-06 23:03:39 +00:00
|
|
|
<!-- Check if 'sortable' is true, and if so, add the 'sortable-table' class -->
|
|
|
|
{{ if $sortable }}
|
|
|
|
{{ $html = replaceRE "<table>" "<table class=\"sortable-table\">" $html | safeHTML }}
|
|
|
|
{{ end }}
|
2019-04-10 05:20:12 +00:00
|
|
|
{{ $html }}
|