diff --git a/server/src/nm.rs b/server/src/nm.rs index 1b440c8..b317461 100644 --- a/server/src/nm.rs +++ b/server/src/nm.rs @@ -17,7 +17,7 @@ use crate::{ Attachment, Body, DispositionType, Email, EmailThread, Header, Html, Message, PlainText, Tag, Thread, ThreadSummary, UnhandledContentType, }, - linkify_html, sanitize_html, + linkify_html, InlineStyle, SanitizeHtml, Transformer, }; const TEXT_PLAIN: &'static str = "text/plain"; @@ -169,17 +169,29 @@ pub async fn thread( }; Body::Html(Html { - html: format!( - r#"
{}
"#, - // Trim newlines to prevent excessive white space at the beginning/end of - // presenation. Leave tabs and spaces incase plain text attempts to center a - // header on the first line. - sanitize_html( - &linkify_html(&text.trim_matches('\n')), - &cid_prefix, - &base_url - )? - ), + html: { + let body_tranformers: Vec{}
"#, + // Trim newlines to prevent excessive white space at the beginning/end of + // presenation. Leave tabs and spaces incase plain text attempts to center a + // header on the first line. + html + ) + }, content_tree: if debug_content_tree { render_content_type_tree(&m) } else { @@ -187,8 +199,27 @@ pub async fn thread( }, }) } - Body::Html(Html { html, content_tree }) => Body::Html(Html { - html: sanitize_html(&html, &cid_prefix, &base_url)?, + Body::Html(Html { + mut html, + content_tree, + }) => Body::Html(Html { + html: { + let body_tranformers: Vec