Repository navigation
🐛 FIX: Reserve inline footnote IDs before parsing content - #162
Open
civilwarinfrance wants to merge 1 commit into
Open
civilwarinfrance wants to merge 1 commit into
civilwarinfrance wants to merge 1 commit into
Conversation
AI-assisted investigation, implementation and testing with OpenAI Codex.
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.
Inline notes allocate their ID before parsing their content but only insert the note afterward. If that content references another note, both notes receive the same ID and the outer note overwrites the inner one. A later reference can then raise KeyError('count').
Reproducer:
Reserve the outer note's entry before recursive inline parsing, retaining the same token list while it is populated. Each note then keeps its own ID and content. Fourteen regression cases cover named references, repeated references, nested inline notes, pre-existing notes and both move_to_end modes; rendered anchors must be unique and all internal targets must exist. Unchanged master fails 10 cases, with 4 controls passing. The docs and changelog describe the corrected behavior.
Validation through tox on macOS ARM64:
AI disclosure: OpenAI Codex assisted with code inspection, reproduction, implementation, tests and this description. This is a reproduced code-inspection finding; no production incident, personal human review or upstream acceptance is claimed.