Skip to content

Fix uneven backtick handling - #1669

Merged
waylan merged 2 commits into
Python-Markdown:masterfrom
facelessuser:bugfix/backtic-regression
Oct 21, 2026
Merged

waylan merged 2 commits into
Python-Markdown:masterfrom
facelessuser:bugfix/backtic-regression

Conversation

@facelessuser

Copy link
Copy Markdown
Collaborator
  1. Ensure start is only adjusted with the longest closing code span is less than the opening and greater than 0.
  2. Remove dead code as we should always find an opening.
  3. find_code_span will always return an opening. End will be None if a match could not be found.
  4. Ensure the beginning backticks are not parsed again if no end was found.

Fixes #1668

Description

AI Assistance Disclosure

  • No AI tools were used in preparing this PR.

  • AI tools were used and I have disclosed which ones, and have fully reviewed and verified their output.

    AI tools were use to assist with the following:

    • Code
    • Code Comments
    • Documentation
    • Changelog Entry
    • Commit Message
    • The Description Above
    • Other: ______________

Checklist

facelessuser and others added 2 commits October 21, 2026 06:38
1. Ensure start is only adjusted with the longest closing code span is
   less than the opening and greater than 0.
2. Remove dead code as we should always find an opening.
3. `find_code_span` will always return an opening. End will be `None` if
   a match could not be found.
4. Ensure the beginning backticks are not parsed again if no end was
   found.

Fixes Python-Markdown#1668
Comment thread docs/changelog.md Outdated

* Escape the language name in the `codehilite` extension's non-Pygments output to
maintain consistency with Pygments output.
* Fix regression in `BacktickInlineProcessor` where text could be lost when opening and closing backticks did not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have noticed this in a few of your recent PRs. Every entry in a changelog must be nested under a level 3 heading of either Fixed, Changed, Added, or Removed. You keep leaving that out, which causes deployment to fail when our deploy script attempts to extract the release notes from the changelog. I don't know why the changelog validator doesn't catch it in a non-release. I fixed it hear when I resolved a merge conflict, but I wanted to bring it to your attention.

@waylan
waylan merged commit 59f6dbc into Python-Markdown:master Oct 21, 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.

Unmatched backtick runs swallow text in 3.11 (inline code)

2 participants