Skip to content

End a Code Span at an HTML Block Line in pr_review.py - #3229

Merged
ptr727 merged 2 commits into
developfrom
feature/code-span-html-block
Oct 19, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/code-span-html-block

Conversation

@ptr727

@ptr727 ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

CODE_SPAN in scripts/pr_review.py ended an inline code span only at a blank line. GitHub also ends a paragraph at a line opening an HTML block, so a stray backtick before </details> paired with the first tick of the next entry's summary, and unwrap printed the wrappers between them raw. Implements #3214.

  • HTML_BLOCK_START holds the GFM block starts that may interrupt a paragraph (types 1 to 6), and CODE_SPAN does not continue onto such a line. Type 6 reuses tag_opener, which gains a closer flag and moves above its first use.
  • attestation() drops its span mask. The marker is anchored to a line of its own, which a span can no longer reach, so the mask changed nothing. The maintainer chose to follow GitHub's rendering here: a trusted author's marker on its own line between two stray ticks is a real HTML comment, so it now attests.
  • Two tests encoded a span crossing such a line and now read it as GitHub renders it. The stated_total test now pins the offset alignment the opener mask provides.

Verification

  • The constructed case from End a Code Span at an HTML Block Line in pr_review.py #3214 fails with the fix reverted and passes with it. Each block-start alternative and the case-insensitive group were mutation-checked against the new rows.
  • python3 -m unittest discover -s tests: OK. ruff, ruff format, mypy, repo_gate.py, the prose gate (whole tree and --diff origin/develop), and build_dist.py --check are clean.
  • Local strict review: two rounds. Round one's introduced findings were fixed in 3a33b75, and round two raised none.

Follow-ups filed

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 19, 2026 08:02
A line opening an HTML block interrupts a paragraph as GitHub renders it, so a stray backtick no
longer pairs across a `</details>` or `<details>` line and masks the wrappers between them.

Fixes #3214

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on Mask

The attestation marker is anchored to a line of its own, which a span can no longer reach, so the
span mask in front of it changed nothing. The block-start rows now pin every alternative.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 19, 2026 15:11
@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

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

@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: 1819fe4e-9407-47e2-8625-14e72334f2f3
  • 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.

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.

🔵 Needs a closer look

Two moderate parsing issues and one documentation nit remain unresolved.

No open issues 🎉

What changed in this PR

Updates review-body parsing so inline code spans stop at GFM HTML block lines, matching GitHub rendering.

Changes:

  • Adds HTML block detection to CODE_SPAN.
  • Refactors tag matching and attestation handling.
  • Updates regression tests for span boundaries and attestations.
File Summary
scripts/​pr_review.py Implements HTML-block-aware span parsing; 2 moderate findings and 1 nit remain.
tests/​test_pr_review.py Adds coverage for HTML boundaries, totals, and attestations.

Review effort: Lite

@ptr727

ptr727 commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

Copilot's round on 3a33b75 opens on "Needs a closer look" and says two moderate parsing issues and one documentation nit remain. It names none of them: it opened no thread, states "No open issues", and its file table only repeats the count. Nothing here is concrete enough to fix or disprove. The local strict review (two rounds, frontier tier) raised two parsing gaps on this code. Both are real, and both predate this change or reach beyond it, so each is filed: #3227 (a span still pairs across a list item, heading, blockquote, or thematic break) and #3228 (the HTML block-name list disagrees with prose_lint.py on source and search). Its other findings were fixed in 3a33b75. No documentation nit was named, so none is answered here.

@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.54%. Comparing base (83e291c) to head (3a33b75).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3229      +/-   ##
===========================================
+ Coverage    65.52%   65.54%   +0.02%     
===========================================
  Files           17       17              
  Lines         9771     9773       +2     
===========================================
+ Hits          6402     6406       +4     
+ Misses        3369     3367       -2     
Flag Coverage Δ
python-3.13 65.54% <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
ptr727 merged commit c39d7f8 into develop Oct 19, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/code-span-html-block branch October 19, 2026 15:38
ptr727 added a commit that referenced this pull request Oct 19, 2026
#3232)

## Summary

This answers Copilot's P2 on promotion #3231. Once #3229 removed the
span mask in front of `attestation()`, a trusted marker on a line of its
own between two stray ticks attests, as GitHub renders it. The docstring
still said a marker "in a span" vouches for nothing. It now says a
marker quoted inline or in a code block vouches for nothing, and that a
tick on each side of the marker's own line opens no span, so the marker
still counts.

## Verification

- The change is docstring-only. ruff, ruff format, the `pr_review`
suite, and the prose gate with `sentence-length` are clean, and the
pre-commit gate passed at commit.
- The local strict review checked each claim against `ATTESTATION`,
`strip_fences`, and the `TestAttestationReadings` rows, and raised no
findings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
ptr727 added a commit that referenced this pull request Oct 19, 2026
…il to Main (#3231)

- #3229 ends an inline code span in `pr_review.py` at a line opening a
GFM HTML block, as GitHub renders it. So a stray backtick no longer
pairs across `</details>` or `<details>`, and the digest no longer
prints those wrappers raw. A trusted author's attestation marker on a
line of its own between two stray ticks now attests, which is the
maintainer's "follow GitHub" decision, and the dead span mask in front
of `attestation()` is gone.
- #3230 gives the `<details>` and `<summary>` opener readers one
attribute tail, `attributes()`. An opener quoted in code as `<details
[^>]*>` is no tag to any of them, and a quoted value holding a `>` is
read whole. The readers spanning lines take a line break where HTML
does.

Neither change edits a skill, so this machine's installed Skills are
unchanged at release.

Closes #3214
Closes #3212

🤖 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