mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Update bs-table shortcode (#31803)
This commit is contained in:
parent
341bd5aa46
commit
afc0e83ecc
1 changed files with 5 additions and 7 deletions
|
@ -1,11 +1,9 @@
|
||||||
{{- /*
|
{{- /*
|
||||||
Usage: `table "class"`,
|
Usage: `bs-table "class class-foo"`,
|
||||||
where class can be anything
|
where class can be anything
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
{{ $htmlTable := .Inner | markdownify }}
|
{{- $css_class := .Get 0 | default "table" -}}
|
||||||
{{ $css_class := .Get 0 | default "table" }}
|
{{- $html_table := .Inner | markdownify -}}
|
||||||
{{ $old := "<table>" }}
|
{{- $html_table = replace $html_table "<table>" (printf `<table class="%s">` $css_class) -}}
|
||||||
{{ $new := printf "<table class=\"%s\">" $css_class }}
|
{{- $html_table | safeHTML -}}
|
||||||
{{ $htmlTable := replace $htmlTable $old $new }}
|
|
||||||
{{ $htmlTable | safeHTML }}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue