0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Update bs-table shortcode (#31803)

This commit is contained in:
XhmikosR 2020-10-22 09:32:46 +03:00 committed by GitHub
parent 341bd5aa46
commit afc0e83ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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 -}}