diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-10-22 09:32:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 09:32:46 +0300 |
commit | afc0e83ecc00e748a617861be3318522069bd3eb (patch) | |
tree | 9dc101abede11b1422fb083c8225181500dd660c /site/layouts | |
parent | 341bd5aa4652fe9be56967ebda71958145ead95c (diff) |
Update bs-table shortcode (#31803)
Diffstat (limited to 'site/layouts')
-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 6f972d6651..40b9b8ce56 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 -}} |