Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
afc0e83e
Unverified
Commit
afc0e83e
authored
4 years ago
by
XhmikosR
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Update bs-table shortcode (#31803)
parent
341bd5aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
site/layouts/shortcodes/bs-table.html
+5
-7
site/layouts/shortcodes/bs-table.html
with
5 additions
and
7 deletions
+5
-7
site/layouts/shortcodes/bs-table.html
+
5
-
7
View file @
afc0e83e
{{- /*
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 -}}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment