Poorly structured markdown can result in a counter-intuitive ToC output.
It looks like the heading is not generated via the AST, but through some string processing.
This seems to be an old issue (#1778).
---
title: "Markdown Syntax Guide"
date: 2024-10-01T23:17:15+08:00
draft: false
---
#### not h1/h2 first
## Headings
↓ The heading in the blockquote element.
Hopefully it will be possible to jump by ID, the same behavior as other heading elements.
> # H1
>
> ## H2
## Table
##### heading
↑ Some non-incrementing headings.
ToC result:
Expected intuitive ToC output:
What version of Hugo are you using (hugo version)?
$ hugo version
hugo v0.134.3-5fb333b9f5ff4ec018f9d78910177d0bec1befb0+extended linux/amd64 BuildDate=2024-09-19T14:28:20Z VendorInfo=hugomods
Does this issue reproduce with the latest release?
Poorly structured markdown can result in a counter-intuitive ToC output. It looks like the heading is not generated via the AST, but through some string processing. This seems to be an old issue (#1778).
With config:
And markdown for test:
ToC result:
Expected intuitive ToC output:
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
yes