Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-05-02 18:38:25 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-06-03 15:57:20 +0300
commit08742abda3a7e9717c5c6508537191e68986a24e (patch)
tree539333c6aa414ff574ff523b98d1b416f20bcdfc /site/layouts
parent9a5b4766ae510d21dac73b580e5e62e5061f2ca3 (diff)
shortcodes/example.html: allow specifying the highlighting language
Diffstat (limited to 'site/layouts')
-rw-r--r--site/layouts/shortcodes/example.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/site/layouts/shortcodes/example.html b/site/layouts/shortcodes/example.html
index 6701b1377b..cebb06ad47 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 -}}