Bug: unexpected behavior when using Auto-Links and Auto-Identifiers extensions #569

Open
opened 2026-01-29 14:39:58 +00:00 by claunia · 0 comments
Owner

Originally created by @keylime-unicorn on GitHub (Oct 5, 2022).

Combining the Auto-Link and the Auto-Identifier extensions results in an unexpected parse of the original markdown. Using only the Auto-Links extension generates the expected parse, so the issue only occurs when the two extensions are used together.

The following markdown was used to test this issue:
image

When only using the Auto-Links extension, the HTML generated from the markdown above looks like this:
image

When using both the Auto-Link and the Auto-Identifier extensions, the HTML generated from the markdown above looks like this:
image

It seems that the issue only occurs when the text in the nested square brackets exactly matches an existing heading in the markdown document.

Originally created by @keylime-unicorn on GitHub (Oct 5, 2022). Combining the Auto-Link and the Auto-Identifier extensions results in an unexpected parse of the original markdown. Using only the Auto-Links extension generates the expected parse, so the issue only occurs when the two extensions are used together. The following markdown was used to test this issue: ![image](https://user-images.githubusercontent.com/25823466/194134712-03dc9a96-5a65-4fd7-a02b-5e757856f5c3.png) When only using the Auto-Links extension, the HTML generated from the markdown above looks like this: ![image](https://user-images.githubusercontent.com/25823466/194136295-8aeadfad-af67-4192-8509-69ac22d66d07.png) When using both the Auto-Link and the Auto-Identifier extensions, the HTML generated from the markdown above looks like this: ![image](https://user-images.githubusercontent.com/25823466/194135279-8c19ccf3-f302-4f54-a817-97c714146998.png) It seems that the issue only occurs when the text in the nested square brackets exactly matches an existing heading in the markdown document.
claunia added the bugPR Welcome! labels 2026-01-29 14:39:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#569