File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2
2
{{ $codeBlockId := printf "id-%x" (now.UnixNano) }}
3
3
{{ $lines := split $result.Wrapped "\n" }}
4
4
{{ $isSingleLine := eq (len $lines) 1 }}
5
+ {{- $opts := dict "noClasses" false -}}
6
+ {{- $lang := .Type -}}
7
+ {{- $highlightingResult := transform.HighlightCodeBlock . $opts -}}
5
8
6
9
{{- if $isSingleLine -}}
7
10
< div class ="code-block " data-mf ="true " style ="display: none; ">
20
23
< div class ="code-container chroma ">
21
24
< button onclick ="copyToClipBoard(this, {{ $codeBlockId }}) " class ="code-copy-button multi-line " type ="button "> Copy</ button >
22
25
< div class ="highlight-v2 " id ="{{ $codeBlockId }} ">
23
- {{ $result.Wrapped }}
26
+ < div class =" highlight " > < pre class =" chroma " tabindex =" 0 " > < code class =" language- {{ $lang }} " data-lang =" {{ $lang }} " > {{- $highlightingResult.Inner -}} </ code > </ pre > </ div >
24
27
</ div >
25
28
</ div >
26
29
</ div >
30
+
27
31
{{- end -}}
28
32
< div id ="code-block-v1 " data-mf ="false ">
29
33
{{ $result.Wrapped }}
You can’t perform that action at this time.
0 commit comments