Repository navigation
Keep numbering tokens literal inside inline code - #783
Open
mayankdhingra02 wants to merge 2 commits into
Open
mayankdhingra02 wants to merge 2 commits into
mayankdhingra02 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the
numberingextra, a literal caption example inside inline code is expanded into escaped<figcaption>markup and consumes a counter. The next real caption is then numbered incorrectly. Literal[@reference]examples are also rewritten.Check numbering opener positions against the parser's code spans before evaluating the full caption or reference pattern. Both passes use the same interval scan; repeated incomplete literal openers cannot consume a later real caption or repeatedly rescan its suffix. Two new fixture groups cover forward references, multi-backtick spans, literal references and the existing fenced-code behavior. Ordinary caption and reference handling is preserved.
make testone(312 tests) andmake testredos(12 cases) pass on CPython 3.10.13, 3.11.12, 3.12.9, 3.13.3 and 3.14.4 with all optional extras installed. Both new fixtures fail on the unchanged base. Wheel/sdist builds, Twine checks and installed-package checks pass. These are macOS arm64 checks; Linux and Windows CI are separate.Unbackticked indented code blocks remain a known limitation. The current code-span recognizer is reused. Suggested note for the numbering wiki: caption definitions and references inside recognized inline code spans remain literal and do not affect counters.