Compare commits

...

2 Commits

Author SHA1 Message Date
0f1a60a348 Sanitize html when linkifying plain text. 2024-02-03 11:15:57 -08:00
c59a883351 Address lint. 2024-02-03 11:14:43 -08:00
2 changed files with 5 additions and 6 deletions

View File

@ -1,11 +1,10 @@
use std::{ use std::{
error::Error, error::Error,
io::{stdout, Write}, io::{stdout, Write},
time::{Duration, Instant}, time::Instant,
}; };
use itertools::Itertools; use notmuch::Notmuch;
use notmuch::{Notmuch, NotmuchError, SearchSummary, ThreadSet};
use rayon::iter::{ParallelBridge, ParallelIterator}; use rayon::iter::{ParallelBridge, ParallelIterator};
#[test] #[test]
@ -27,7 +26,7 @@ fn parse_one() -> Result<(), Box<dyn Error>> {
.enumerate() .enumerate()
.par_bridge() .par_bridge()
.for_each(|(i, msg)| { .for_each(|(i, msg)| {
let ts = nm let _ts = nm
.show(&msg) .show(&msg)
.expect(&format!("failed to show msg: {}", msg)); .expect(&format!("failed to show msg: {}", msg));
//println!("{:?}", ts); //println!("{:?}", ts);
@ -79,7 +78,7 @@ fn parse_bulk() -> Result<(), Box<dyn Error>> {
//.par_bridge() //.par_bridge()
.for_each(|(i, msgs)| { .for_each(|(i, msgs)| {
let query = msgs.join(" OR "); let query = msgs.join(" OR ");
let ts = nm let _ts = nm
.show(&query) .show(&query)
.expect(&format!("failed to show msgs: {}", query)); .expect(&format!("failed to show msgs: {}", query));
//println!("{:?}", ts); //println!("{:?}", ts);

View File

@ -350,7 +350,7 @@ impl QueryRoot {
Body::PlainText(PlainText { text, content_tree }) => Body::Html(Html { Body::PlainText(PlainText { text, content_tree }) => Body::Html(Html {
html: format!( html: format!(
r#"<p class="view-part-text-plain">{}</p>"#, r#"<p class="view-part-text-plain">{}</p>"#,
linkify_html(&text) sanitize_html(&linkify_html(&text))?
), ),
content_tree: if debug_content_tree { content_tree: if debug_content_tree {
render_content_type_tree(&m) render_content_type_tree(&m)