{{- $caption := .Attributes.caption -}}
{{- $type := .Type | default "text" -}}
{{- $options := .Attributes.options | default "default=1" -}}
{{- $hash := print (truncate 3 "" (sha256 .Inner)) (truncate 3 "" (sha256 .Page.RelPermalink)) .Ordinal -}}
{{- $id := print "code-block:" $hash | safeURL -}}
{{- $highlight := highlight .Inner $type (print $options ",lineAnchors=" "code-line:" $hash) -}}
{{- replace $highlight
`class="lnlinks"`
`contenteditable="false" class="lnlinks"`
| safeHTML
-}}
{{- with $caption -}}
{{- end -}}