xoofx / xoofx/markdig

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

Open
#668 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug PR Welcome!
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported markdown with the Auto-Link extension alone, then with Auto-Link and Auto-Identifier enabled together. Compare the generated HTML, especially when nested square-bracket text exactly matches an existing heading. Done means the combined extensions produce the expected parse without the reported unexpected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.