Skip to content

Support parens in links#154

Open
Janiczek wants to merge 1 commit intodillonkearns:masterfrom
Janiczek:janiczek-parens-in-links
Open

Support parens in links#154
Janiczek wants to merge 1 commit intodillonkearns:masterfrom
Janiczek:janiczek-parens-in-links

Conversation

@Janiczek
Copy link
Copy Markdown

@Janiczek Janiczek commented May 2, 2026

Fixes #153

Makes CommonMark 495 pass: [link](foo(and(bar)))

The issue with keeping the existing regex approach for me was that we needed to balance the parentheses. Maybe there is some lookahead / lookbehind regex magic that could do this, but I didn't figure it out.

So instead we walk the string and count ( and ) as we go.


Also, the E2E test new/link_lt kept popping up as newly failing. But both Commonmark and Marked.js demo playgrounds kept giving me a different result than elm-markdown test suite expected, so I opted to fix that test.

@Janiczek Janiczek force-pushed the janiczek-parens-in-links branch from ed4ce81 to da2322e Compare May 2, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links with parentheses (common for Wikipedia links) don't parse correctly

1 participant