The link text may contain balanced brackets #326

Closed
opened 2026-01-29 14:33:50 +00:00 by claunia · 0 comments
Owner

Originally created by @yishengjin1413 on GitHub (Sep 27, 2019).

From the commonmark, the the link text may contain balanced brackets https://spec.commonmark.org/0.29/#example-508. Please see the line before this example:

But for the following example:

[link [foo][bar]](/uri)

It will render to

<p>
  [link <a href="/uri">foo][bar]</a>
</p>

The other example like:

[link [foo] [bar]](/uri)

works well.

Please see https://babelmark.github.io/?text=%5Blink+%5Bfoo%5D%5Bbar%5D%5D(%2Furi)%0A%0A%5Blink+%5Bfoo%5D+%5Bbar%5D%5D(%2Furi).

Originally created by @yishengjin1413 on GitHub (Sep 27, 2019). From the commonmark, the the link text may contain balanced brackets https://spec.commonmark.org/0.29/#example-508. Please see the line before this example: But for the following example: ``` [link [foo][bar]](/uri) ``` It will render to ``` <p> [link <a href="/uri">foo][bar]</a> </p> ``` The other example like: ``` [link [foo] [bar]](/uri) ``` works well. Please see https://babelmark.github.io/?text=%5Blink+%5Bfoo%5D%5Bbar%5D%5D(%2Furi)%0A%0A%5Blink+%5Bfoo%5D+%5Bbar%5D%5D(%2Furi).
claunia added the bug label 2026-01-29 14:33:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#326