Skip to content

fix(email): add <hr> to HTML body detection tag list - #40

Merged
dizhaky merged 1 commit into
mainfrom
dan/email-hr-tag-detection
Jun 28, 2026
Merged

fix(email): add <hr> to HTML body detection tag list#40
dizhaky merged 1 commit into
mainfrom
dan/email-hr-tag-detection

Conversation

@dizhaky

@dizhaky dizhaky commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Adds <hr> to _HTML_TAGS in gateway/platforms/email.py. The <hr> void element is commonly used as a horizontal divider in HTML emails; without it, emails whose only HTML marker was <hr> were classified as plain text and sent without the multipart/alternative wrapper.

Supersedes #38 (had unsigned commits; rewritten with a signed commit).

Test plan

  • Send an HTML email containing only <hr> as its HTML indicator — should be detected as HTML and sent as multipart/alternative
  • Plain-text emails remain plain-text (no regression)
  • CI green

🤖 Generated with Claude Code


Note

Low Risk
Single-tag addition to an existing HTML-detection regex; no auth, SMTP, or IMAP logic changes.

Overview
Adds hr to the _HTML_TAGS pattern used by _HTML_BODY_RE / _is_html_body in the email gateway.

Bodies that only include a horizontal rule (e.g. <hr> or <hr/>) are now treated as HTML instead of plain text, so _attach_body keeps the markup in the HTML part and strips it for the plain alternative rather than escaping the whole body as preformatted text.

Reviewed by Cursor Bugbot for commit ad0a3b3. Configure here.

<hr> is a self-closing void element commonly used as a divider in HTML
emails. Without it in _HTML_TAGS, emails whose only HTML marker is a
horizontal rule were sent as plain text instead of multipart/alternative.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

🔎 Lint report: dan/email-hr-tag-detection vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8649 on HEAD, 8649 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4570 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@dizhaky
dizhaky merged commit 9d2d76f into main Jun 28, 2026
29 checks passed
@dizhaky
dizhaky deleted the dan/email-hr-tag-detection branch June 28, 2026 02:48
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.

1 participant