linkify URLs in plaintext emails.
This commit is contained in:
@@ -16,7 +16,7 @@ use memmap::MmapOptions;
|
||||
use notmuch::Notmuch;
|
||||
use rocket::time::Instant;
|
||||
|
||||
use crate::sanitize_html;
|
||||
use crate::{linkify_html, sanitize_html};
|
||||
|
||||
pub struct QueryRoot;
|
||||
|
||||
@@ -347,8 +347,11 @@ impl QueryRoot {
|
||||
.get_first_value("date")
|
||||
.and_then(|d| mailparse::dateparse(&d).ok());
|
||||
let body = match extract_body(&m)? {
|
||||
Body::PlainText(PlainText { text, content_tree }) => Body::PlainText(PlainText {
|
||||
text,
|
||||
Body::PlainText(PlainText { text, content_tree }) => Body::Html(Html {
|
||||
html: format!(
|
||||
r#"<p class="view-part-text-plain">{}</p>"#,
|
||||
linkify_html(&text)
|
||||
),
|
||||
content_tree: if debug_content_tree {
|
||||
render_content_type_tree(&m)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user