Repository navigation
Strip an Attributed Details or Summary Opener Through TAGS in pr_review.py - #3213
Conversation
…ew.py TAGS matched a bare tag alone, so `<details open>`, `<summary class="x">`, and `<summary/>` printed raw from unwrap and stayed on an entry_heading read. Its opener arm now ends the tag name through tag_opener, and the attribute run stops at a line's end so a tag left open there strips none of the prose after it. Closes #3208. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first cut stripped everything from a tag name to the next `>`, so an opener quoted in a code span, such as `<details [^>]*>`, ate the finding's text up to that `>`. The attribute now opens on a letter after whitespace, the guard SUMMARY already holds, kept to the opener's own line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Requiring a letter after the whitespace left `<summary />` and `<details >` printed raw, and a self-closed opener is one the change is for. The letter is now required only of an attribute that is there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
Attributed tags inside inline code can still be incorrectly removed.
1 open issue
What changed in this PR
Updates TAGS to strip attributed and self-closing <details> and <summary> openers, with expanded regression coverage.
Changes:
- Adds bounded attribute matching.
- Tests valid, malformed, code-span, and heading cases.
- Leaves one issue: valid attributed tags in inline code may be stripped.
| File | Description |
|---|---|
scripts/pr_review.py |
Expands TAGS opener matching. |
tests/test_pr_review.py |
Adds coverage for new tag shapes and boundaries. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3213 +/- ##
===========================================
+ Coverage 65.50% 65.52% +0.02%
===========================================
Files 17 17
Lines 9761 9767 +6
===========================================
+ Hits 6394 6400 +6
Misses 3367 3367
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
unwrap stripped TAGS from the raw block, so a finding quoting `<details open>` in a code span lost the tag from its own text. The tags are now found in a copy with every fence and code span masked, which keeps their offsets, and cut from the original there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tail admitting any text after a letter took prose such as `<details element's open attribute -> false` for a tag and deleted it. HTML_TAG's attribute grammar, now shared as ATTRIBUTES, admits only names and quoted or bare values, and reads a `>` inside a quoted value as part of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
- #3213 makes `TAGS` in `pr_review.py` strip an attributed or self-closed `<details>` or `<summary>` opener the same way it strips a bare one, so `<details open>`, `<summary class="x">`, and `<summary/>` no longer print raw in the digest. The tag name ends through `tag_opener`, and the attribute tail is `HTML_TAG`'s grammar, now shared as `ATTRIBUTES`. So prose such as `<details element's ... ->` stays text, and a `>` inside a quoted value belongs to its tag. `unwrap` also finds its tags in a copy with every fence and code span masked, so a tag a finding quotes in code stays in its text. Follow-ups are filed as #3212, #3214, and #3215. The change is to scripts and tests only, so no installed Skill changes at release. Closes #3208 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
TAGSinscripts/pr_review.pynow strips an attributed or self-closed<details>or<summary>opener the same way it strips a bare one. Before this,<details open>,<summary class="x">, and<summary/>printed raw fromunwrap, and a closer-less attributed heading failed itsentry_headingread.tag_opener, so<summaryx>and<details/x>stay text.HTML_TAG's existing grammar, which both readers now share asATTRIBUTES.HTML_TAG's compiled pattern is unchanged. The grammar keeps prose such as<details element's open attribute -> falseas text, reads a>inside a quoted value as part of the tag, and stops at the opener's own line.unwrapfinds its tags in a copy with every fence and code span masked, then cuts them from the original at the same offsets. So a finding that quotes`<details open>`in code keeps it.entry_headingread. Each assertion fails on the code it replaces.Part of #3208.
Local review findings
A recorded
local-strict-reviewpass covers the current head, and it raised nothing. Earlier passes found these, all fixed on this branch:[^>]*>tail ate code-span text, fixed in ec80b66.<summary />raw, fixed in 27ea68b.Filed rather than fixed here:
CODE_SPANpairs a stray backtick across an HTML block line, which can leave a wrapper tag printed raw.reducedstrips an emphasis tag quoted in code.🤖 Generated with Claude Code