fix(email): add <hr> to HTML body detection (Codex P2 follow-up) - #38
Closed
dizhaky wants to merge 2 commits into
Closed
fix(email): add <hr> to HTML body detection (Codex P2 follow-up)#38dizhaky wants to merge 2 commits into
dizhaky wants to merge 2 commits into
Conversation
3 tasks
🔎 Lint report:
|
dizhaky
marked this pull request as ready for review
June 28, 2026 02:30
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
dizhaky
enabled auto-merge (squash)
June 28, 2026 02:30
Owner
Author
|
Closing: the branch had unsigned commits (CI cursor-agent + my empty re-trigger commit). Reopened with signed commit at #40. |
auto-merge was automatically disabled
June 28, 2026 02:43
Pull request was closed
3 tasks
This was referenced Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #37 Codex P2 review — the one remaining unaddressed structural gap in
_is_html_body().What changed
_HTML_TAGSingateway/platforms/email.py(line 241) lackedhr, a common void element used in HTML digest emails. Outgoing emails whose only or first recognizable markup was<hr>or<hr/>were misclassified as plain text, sending the horizontal rule as a literal<hr>string inside atext/plainpart.One-character change: added
hr|to the alternation.Why safe
<hr>is a void element with no closing tag and takes no text content, so:>or/>directly afterhr, so prose comparisons likex<hrdo not match.<style>/<script>stripping (lines 172–179) and all other_strip_htmlpasses are unaffected._HTML_CLOSE_TAGSlist (used for closing-tag detection) does not needhrsince</hr>is not valid HTML.Codex P2 status after this PR
All 15 Codex P2 findings from PR #37 are now addressed:
_text_to_html()escapes< > &for non-HTML bodiesimg,pre)<hr>standalone tagpre-wrap; word-wrap: break-word_strip_html()on HTML bodieshref/nameattributep,code,divcomparisons as HTML>or/>orattr=label (url)format</p>,</li>,</tr>→ newlines</td><td>→ tab[image: alt (url)]formatwhite-space: pre-wrap🤖 Generated with Claude Code
Generated by Claude Code
Note
Low Risk
Single-tag addition to an existing heuristic regex with no auth, data, or API surface changes.
Overview
Adds
hrto the_HTML_TAGSalternation used by_HTML_BODY_RE/_is_html_body()ingateway/platforms/email.py.Outgoing bodies whose only recognizable markup was a void
<hr>or<hr/>were treated as plain text, so_attach_body()escaped them and recipients saw a literal<hr>string instead of a horizontal rule. Withhrin the detector, those digests are classified as HTML and the HTML part is sent as-is.No change to
_HTML_CLOSE_TAGS(void element). Existing regex rules still require a real tag terminator, so prose likex<hrshould not match.Reviewed by Cursor Bugbot for commit 01c8bd2. Configure here.