diff options
| author | XhmikosR <[email protected]> | 2020-05-02 18:38:25 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-06-03 15:57:20 +0300 |
| commit | 08742abda3a7e9717c5c6508537191e68986a24e (patch) | |
| tree | 539333c6aa414ff574ff523b98d1b416f20bcdfc | |
| parent | 9a5b4766ae510d21dac73b580e5e62e5061f2ca3 (diff) | |
| download | bootstrap-08742abda3a7e9717c5c6508537191e68986a24e.tar.xz bootstrap-08742abda3a7e9717c5c6508537191e68986a24e.zip | |
shortcodes/example.html: allow specifying the highlighting language
| -rw-r--r-- | site/layouts/shortcodes/example.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/site/layouts/shortcodes/example.html b/site/layouts/shortcodes/example.html index 6701b1377..cebb06ad4 100644 --- a/site/layouts/shortcodes/example.html +++ b/site/layouts/shortcodes/example.html @@ -8,6 +8,7 @@ show_markup: if the markup should be output in the HTML - default: `true` */ -}} +{{- $lang := .Get "lang" | default "html" -}} {{- $show_preview := .Get "show_preview" | default true -}} {{- $show_markup := .Get "show_markup" | default true -}} {{- $input := .Inner -}} @@ -21,5 +22,5 @@ {{- if eq $show_markup true -}} {{- $content := replaceRE `<svg class="bd\-placeholder\-img(?:\-lg)?(?: *?bd\-placeholder\-img\-lg)? ?(.*?)".*?<\/svg>\n` `<img src="..." class="$1" alt="...">` $input -}} {{- $content = replaceRE `(class=" *?")` "" $content -}} - {{- highlight (trim $content "\n") "html" "" -}} + {{- highlight (trim $content "\n") $lang "" -}} {{- end -}} |
