Repository navigation
Conversation
…ew.py (#3213) ## Summary `TAGS` in `scripts/pr_review.py` now 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 from `unwrap`, and a closer-less attributed heading failed its `entry_heading` read. - The opener arm ends the tag name through `tag_opener`, so `<summaryx>` and `<details/x>` stay text. - The attribute tail is `HTML_TAG`'s existing grammar, which both readers now share as `ATTRIBUTES`. `HTML_TAG`'s compiled pattern is unchanged. The grammar keeps prose such as `<details element's open attribute -> false` as text, reads a `>` inside a quoted value as part of the tag, and stops at the opener's own line. - `unwrap` finds 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. - A test pins the stripped shapes, the kept shapes, the line bound, the quoted and prose cases, and the `entry_heading` read. Each assertion fails on the code it replaces. Part of #3208. ## Local review findings A recorded `local-strict-review` pass covers the current head, and it raised nothing. Earlier passes found these, all fixed on this branch: - A `[^>]*>` tail ate code-span text, fixed in ec80b66. - Requiring a letter after the whitespace left `<summary />` raw, fixed in 27ea68b. - The tail accepted prose as an attribute run, fixed in bc54c3a. Filed rather than fixed here: - #3212: the attribute tail is still spelled separately at the other opener readers. - #3214: `CODE_SPAN` pairs a stray backtick across an HTML block line, which can leave a wrapper tag printed raw. - #3215: `reduced` strips an emphasis tag quoted in code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- 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 |
There was a problem hiding this comment.
🔵 Needs a closer look
Quoted code spans are removed before masking, causing the new quoted-markup behavior to fail.
No open issues 🎉
What changed in this PR
Promotes attributed and self-closing <details>/<summary> stripping in pr_review.py, with regression coverage.
Changes:
- Shares HTML attribute parsing between tag readers.
- Updates quotation-aware unwrapping.
- Adds tests for attributes, boundaries, and quoted markup.
| File | Summary |
|---|---|
tests/test_pr_review.py |
Adds regression tests for tag handling. |
scripts/pr_review.py |
Updates tag parsing and unwrapping behavior. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3216 +/- ##
==========================================
+ 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:
|
|
Answering the round's headline, "Quoted code spans are removed before masking, causing the new quoted-markup behavior to fail": declined, the claim does not hold on this head.
|
TAGSinpr_review.pystrip 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 throughtag_opener, and the attribute tail isHTML_TAG's grammar, now shared asATTRIBUTES. So prose such as<details element's ... ->stays text, and a>inside a quoted value belongs to its tag.unwrapalso 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 Share One Attribute Tail Across the Details and Summary Opener Readers in pr_review.py #3212, End a Code Span at an HTML Block Line in pr_review.py #3214, and Keep an Emphasis Tag Quoted in Code When reduced Strips Emphasis in pr_review.py #3215.The change is to scripts and tests only, so no installed Skill changes at release.
Closes #3208
🤖 Generated with Claude Code