Skip to content

Codeblock render hook gets used when it shouldn't #13651

Closed
@chalin

Description

@chalin

As of v0.146.x, codeblocks without language specifiers get processed by the language-specific project-defined codeblock render hooks, but it shouldn't.

For example, if I create a codeblock render hook for the language what, and process the following markdown:

```what
some content
```

```
note that there is no lang spec on this element
```

... as of Hugo 0.146.x, the second codeblock gets processed as if it had the what language specifier. Here's a diff of the output, generated from the attached minimal test project:

Image

📎 Minimal test project: hugo-code-block-test.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions