{{ $hasCaption := isset .Params "caption" }} {{ $caption := .Get "caption" }} {{ $sortable := .Get "sortable" }} {{ $captionEl := printf "" $caption }} {{ $table := .Inner | markdownify }} {{ $html := cond $hasCaption ($table | replaceRE "
%s
" $captionEl) $table | safeHTML }} {{ if $sortable }} {{ $html = replaceRE "
" "
" $html | safeHTML }} {{ end }} {{ $html }}