mirror of https://github.com/twbs/bootstrap.git
Create a new table shortcode so we can easily add Bootstrap table classes to Markdown tables
This commit is contained in:
parent
0408799ae5
commit
85ac2fc35e
|
|
@ -0,0 +1,11 @@
|
|||
{{- /*
|
||||
Usage: `table "class"`,
|
||||
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 }}
|
||||
Loading…
Reference in New Issue