Fix heading auto-link hijacking nested link labels (#668) (#949)

* Fix heading auto-link hijacking nested link labels (#668)

* Refactor heading reference resolution to init-only state (#949)

---------

Co-authored-by: Alexandre Mutel <alexandre_mutel@live.com>
This commit is contained in:
dualfrozandAlexandre Mutel committed 2026-09-19 11:41:48 +02:00
1 parent 40eebc0cd8
commit 9006f0b4a2
6 files changed
+114 -1

No files matched your search

+6
View File
@@ -28,6 +28,12 @@ You can then link to it:
See [Getting Started](#getting-started).
```
With the default `AutoLink` option, `[Getting Started]` also links to the heading.
These implicit heading references do not resolve inside another still-open link or
image bracket. For example, `[Read [Getting Started]](/guide)` links the entire
label `Read [Getting Started]` to `/guide`. Explicit reference definitions such as
`[Getting Started]: /guide` retain normal CommonMark reference-link behavior.
## ID generation rules
1. Convert to lowercase