Skip to content

Fix code spans after an unclosed backtick string - #459

Open
TanbirRamim wants to merge 1 commit into
commonmark:mainfrom
TanbirRamim:code-span-after-unclosed-backticks
Open

TanbirRamim wants to merge 1 commit into
commonmark:mainfrom
TanbirRamim:code-span-after-unclosed-backticks

Conversation

@TanbirRamim

Copy link
Copy Markdown

With an unclosed backtick string before two code spans, like `` a `c`, the second code span was rendered as text. Parsing the first span overwrote the cached closer position that was recorded when the unclosed string scanned to the end, so the later opener looked unmatched. The cache is now only updated before that full scan. I added a test in SpecialInputTest, and the commonmark module tests pass. Fixes #458.

After scanning to the end for an unclosed backtick string, the parser
overwrote the cached last position of each backtick run length while
parsing later code spans. A later opener of the same length then looked
like it had no closer and was left as text.

Fixes commonmark#458
Copilot AI lite review requested due to automatic review settings September 25, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

Second code span not recognised after an unclosed backtick string and another code span

2 participants