Skip to content

Commit f99436f

Browse files
committed
Codeblocks: Use theme switcher for codeblocks
1 parent a3df821 commit f99436f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

assets/css/v2/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ blockquote p:last-child {
745745
}
746746

747747
/* Codeblocks */
748-
.highlight {
748+
.highlight-mf {
749749
grid-column: 1 / -1 !important;
750750
position: relative;
751751
margin-left: calc(var(--overflow-gutter-extension) / -2);
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{{ $code := .Inner | safeHTML }}
22
{{ $lines := split $code "\n" }}
3-
<div class="highlight">
4-
<pre class="chroma" tabindex="0">
3+
<div data-mf="true" class="highlight-mf" style="display: none">
4+
<pre class="chroma" tabindex="0">
55
<code class="language-{{ .Type }}">
66
{{ range $lines }}
77
<span class="line">{{ $line := . }}{{ $parts := split $line "#" }}<span class="code">{{ index $parts 0 | safeHTML }}
88
</span>{{ $commentPart := "" }}{{ if gt (len $parts) 1 }}<span class="comment">{{ index $parts 1 | safeHTML }}</span>{{ end }}</span>
99
{{ end }}
1010
</code>
11-
</pre>
11+
</pre>
1212
</div>
1313

14+
{{ $result := transform.HighlightCodeBlock . }}
15+
{{ $result.Wrapped }}
16+
1417
<!-- ABSOLUTELY DO NOT CHANGE THIS ORDER -->

0 commit comments

Comments
 (0)