Skip to content

Strip an Attributed Details or Summary Opener Through TAGS in pr_review.py - #3213

Merged
ptr727 merged 5 commits into
developfrom
feature/tags-attributed-opener
Oct 19, 2026
Merged

ptr727 merged 5 commits into
developfrom
feature/tags-attributed-opener

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

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:

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 18, 2026 18:57
…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>
Copilot AI lite review requested due to automatic review settings October 19, 2026 02:04
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 430c587b-d02a-4b96-9162-91b5e8f55899
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 27ea68b9f4b7a844c1c8a3ccbe0c2b40f7c2366c, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread scripts/pr_review.py Resolved
@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.52%. Comparing base (9a23b7d) to head (bc54c3a).

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              
Flag Coverage Δ
python-3.13 65.52% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ptr727 and others added 2 commits October 18, 2026 19:17
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>
@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head bc54c3aa932816fdd4e990234e57c2ec3d6a7432, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit d557c3d into develop Oct 19, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/tags-attributed-opener branch October 19, 2026 02:44
ptr727 added a commit that referenced this pull request Oct 19, 2026
- #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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants