I would say you used a fenced code block with ```html resulting in a fixed class using highlight.js XML language <code class="lang-html hljs language-xml"
you want either no class for autodetection or hugo-html
fixed hugo-html results in <code class="lang-hugo-html hljs language-hugo-html">
autodetect results in <class="hljs language-hugo-html">
with class: ```hugo-html
{{ with resources.Get "css/main.css" | css.Build }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ else }}
{{ with . | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{ end }}
autodetect (just ```)
{{ with resources.Get "css/main.css" | css.Build }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{ else }}
{{ with . | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }}
{{ end }}
{{ end }}
importing hugo-text would allow to use ```hugo-text which would only highlight the hugo actions leaving the html unstyled.
while checking how it’s going with the highlight I found that sometimes blocks are not highlighted at all…and not only with my grammar thought about timing linits, … but it was a hard CAP by code block size.
and here is a PR that should solve the problem
Still a hard limit on 30000 bytes
raise the autodetect limit to 2K
if it’s longer, use the first 2000 bytes to try autodetect