]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update bs-table shortcode (#31803)
authorXhmikosR <xhmikosr@gmail.com>
Thu, 22 Oct 2020 06:32:46 +0000 (09:32 +0300)
committerGitHub <noreply@github.com>
Thu, 22 Oct 2020 06:32:46 +0000 (09:32 +0300)
site/layouts/shortcodes/bs-table.html

index 6f972d66513ffe800cced5f9a0098558825ce016..40b9b8ce565bfadda916c420508c00982ec07d18 100644 (file)
@@ -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 -}}