Repository navigation
fix(audit): match backtick code spans within one paragraph or heading - #116
Conversation
visible_source masked code spans across the whole document, so two stray backticks in different paragraphs, or one in a heading and one below it, formed a single span and hid every finding between them: a README with a TODO and an image without alt text audited clean. GitHub renders a lone backtick as plain text. Code spans are now masked block by block: blank lines end a block, and ATX headings, setext underlines and thematic breaks stand alone. A span may still wrap across lines inside one paragraph. Closes #106 Co-Authored-By: Claude Opus 5.5 <[email protected]>
8350c19 to
d94ff8e
Compare
andy-zen-dev
left a comment
There was a problem hiding this comment.
Reviewed exact head d94ff8ed4ed681a5701ce38f33cc04e47a16cd8b against issue #106, the actual four-file diff, tools/repo_audit.py and existing audit tests. The new block-wise masking ends spans at blank lines and heading/thematic boundaries without disturbing source line numbering, while preserving multiline spans within a paragraph. The regression exercises both the reported TODO and missing-alt false negatives, plus the heading boundary and same-paragraph case. The changelog and documented parser limits match the implementation.
The five required jobs in Actions run 39920591483 passed (Python 3.11, 3.14, 3.14 Windows, Ubuntu/Windows action self-tests). I did not run an independent local suite. No merge-blocking issue found within this PR's bounded Markdown subset.
Reader problem and change
A README that mentions the backtick key twice, in two different paragraphs, could hide every audit finding between them.
visible_sourcemasked code spans across the whole document. The stray backticks formed one span, and a README with a TODO and an image without alt text audited clean. GitHub renders a lone backtick as plain text.guides/repository-audit.mdstates the rule, and the changelog has an entry.Closes #106
Evidence
New
tests/test_audit_code_spans.py:readme.placeholderon line 7 andimage.missing_alton line 9. The old code reported nothing.# Press thekeyfollowed byTODO: map thekeyreports the TODO. The old code paired the heading's backtick with the next line.`TODO\nmarkers`inside one paragraph stays masked under both versions. This guards against over-correcting.Verification
Limitations
🤖 Generated with Claude Code