Skip to content

Walk backtick spans instead of matching them with a regex - #1625

Merged
waylan merged 1 commit into
Python-Markdown:masterfrom
gyanu2507:backtick-walk
Aug 30, 2026
Merged

Walk backtick spans instead of matching them with a regex#1625
waylan merged 1 commit into
Python-Markdown:masterfrom
gyanu2507:backtick-walk

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Description

Walks backtick runs by counting characters instead of RE_TICKS.match. Pairing rules are unchanged. This is the scan Isaac sketched in #1618.

Fixes #1620.

Checklist

  • This PR follows the contribution guidelines.
  • The code follows the Code Style Guide.
  • The commit message follows the Commit Message Style Guide.
  • I have added or updated relevant docs, including release notes if applicable which follow the [Documentation Style Guide](Documentation Style Guide).
  • I have added or updated relevant tests.
  • I have not requested, and will not request, an automated AI review for this PR.

Same behavior as the current finder, just a linear scan. Sketch is from
Isaac in Python-Markdown#1618.

Fixes Python-Markdown#1620.

@facelessuser facelessuser left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems to match my proposal, so I'm okay with this.

@waylan
waylan merged commit 8a9ae23 into Python-Markdown:master Aug 30, 2026
14 checks passed
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.

As you already did the work, might as well use it. Feel free to open a new PR.

3 participants