Skip to content

Commit 7b029cd

Browse files
Fix off-by-one rendering of all highlighted lines in the docs! (#4221)
1 parent a0afd23 commit 7b029cd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

layouts/_default/_markup/render-codeblock.html

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
{{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }}
44
<pre
55
{{- range $k, $v := $attributes }}
6-
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
6+
{{- if eq $k "data-line-offset" -}}
7+
data-line-offset="{{ int $v | add -1 }}"
8+
{{- else -}}
9+
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
10+
{{- end -}}
11+
{{- end -}}
12+
{{- if not (isset $attributes "data-line-offset") -}}
13+
data-line-offset="0"
714
{{- end -}}
815
>
916
<code>

0 commit comments

Comments
 (0)