Skip to content

Commit e35bebd

Browse files
authored
Codeblock rendering incorrectly on old theme (#178)
* fix: Codeblock rendering incorrectly on old theme * fix: Scrollbar width showing
1 parent f42a073 commit e35bebd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

assets/css/v2/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ blockquote.side-callout {
10201020
border-top: 1px solid #cccccc;
10211021
border-bottom: 1px solid #cccccc;
10221022
overflow-x: scroll;
1023+
scrollbar-width: none;
10231024
}
10241025

10251026
.highlight-v2.single-line {

layouts/_default/_markup/render-codeblock.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ $lines := split $result.Wrapped "\n" }}
44
{{ $isSingleLine := eq (len $lines) 1 }}
55

6-
{{ if $isSingleLine }}
6+
{{- if $isSingleLine -}}
77
<div class="code-block" data-mf="true" style="display: none;">
88
<div class="code-header no-lang">
99
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
@@ -12,25 +12,23 @@
1212
{{ $result.Wrapped }}
1313
</div>
1414
</div>
15-
{{ else }}
16-
15+
{{- else -}}
1716
<div class="code-block" data-mf="true" style="display: none;">
18-
{{ if and (ne .Type "") (ne .Type "none") }}
17+
{{- if and (ne .Type "") (ne .Type "none") -}}
1918
<div class="code-header">
2019
<span class="code-type">{{ .Type }}</span>
2120
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
2221
</div>
23-
{{ else }}
22+
{{- else -}}
2423
<div class="code-header no-lang">
2524
<button onclick="copyToClipBoard(this)" data-id-codeblock="{{ $codeBlockId }}" class="code-copy-button" type="button">Copy</button>
2625
</div>
27-
{{ end }}
26+
{{- end -}}
2827
<div class="highlight-v2" id="{{ $codeBlockId }}">
2928
{{ $result.Wrapped }}
3029
</div>
3130
</div>
32-
33-
{{ end }}
31+
{{- end -}}
3432
<div id="code-block-v1" data-mf="false">
3533
{{ $result.Wrapped }}
3634
</div>

0 commit comments

Comments
 (0)