-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
What version of Hugo are you using (hugo version
)?
$ hugo version hugo v0.101.0+extended darwin/amd64 BuildDate=unknown
Does this issue reproduce with the latest release?
Yes
The issue
Sometimes, I don't specify a language identifier in a Code Block as follows:
```{foo=true}
bar
```
In the above case, the Render Hooks for Code Block do not receive the attributes.
Is this behavior expected?
I guess this cause is that attrStartIdx
equals 0 if no language identifier ingetAttributes()
.
Ref. https://github.com/gohugoio/hugo/blob/master/markup/goldmark/codeblocks/render.go#L184-L191
If this behavior is a bug, I guess that be fixed by the below diff.
- if attrStartIdx > 0 {
+ if attrStartIdx != -1 {
Ref. b6b15e5
Thanks!