diff options
| -rw-r--r-- | site/layouts/shortcodes/bs-table.html | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/site/layouts/shortcodes/bs-table.html b/site/layouts/shortcodes/bs-table.html index 6f972d665..40b9b8ce5 100644 --- a/site/layouts/shortcodes/bs-table.html +++ b/site/layouts/shortcodes/bs-table.html @@ -1,11 +1,9 @@ {{- /* - Usage: `table "class"`, + Usage: `bs-table "class class-foo"`, where class can be anything */ -}} -{{ $htmlTable := .Inner | markdownify }} -{{ $css_class := .Get 0 | default "table" }} -{{ $old := "<table>" }} -{{ $new := printf "<table class=\"%s\">" $css_class }} -{{ $htmlTable := replace $htmlTable $old $new }} -{{ $htmlTable | safeHTML }} +{{- $css_class := .Get 0 | default "table" -}} +{{- $html_table := .Inner | markdownify -}} +{{- $html_table = replace $html_table "<table>" (printf `<table class="%s">` $css_class) -}} +{{- $html_table | safeHTML -}} |
