Skip to content

Commit 49d4ae8

Browse files
yoyo930021claude
andcommitted
fix: apply HTML sanitization to email sending path as well
Sanitize newsletter HTML immediately after markdown rendering in send_newsletter, before link shortening and tracking rewrite. This ensures dangerous elements are stripped from both the public archive view and outgoing emails. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 895ab78 commit 49d4ae8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/newsletter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ pub async fn send_newsletter(
204204
.map_err(|e| e.to_string())?,
205205
};
206206

207-
// Render markdown → HTML, then absolutize relative image paths for email clients
207+
// Render markdown → HTML, sanitize, then absolutize relative image paths for email clients
208208
let content_html = render_markdown(&markdown_content);
209+
let content_html = sanitize_html(&content_html);
209210
let content_html = absolutize_image_srcs(&content_html, &state.config.base_url);
210211

211212
// Update rendered_html

0 commit comments

Comments
 (0)