remove also tabs from text parts (#280)

This commit is contained in:
Clément DOUIN 2022-02-01 17:10:23 +01:00
parent c1841a2932
commit 134af358e3
No known key found for this signature in database
GPG key ID: 353E4A18EE0FAB72

View file

@ -106,7 +106,7 @@ impl Msg {
.replace_all(&sanitized_html, " ") .replace_all(&sanitized_html, " ")
.to_string(); .to_string();
// Merge new line chars // Merge new line chars
let sanitized_html = Regex::new(r"(\r?\n *){2,}") let sanitized_html = Regex::new(r"(\r?\n[\t ]*){2,}")
.unwrap() .unwrap()
.replace_all(&sanitized_html, "\n\n") .replace_all(&sanitized_html, "\n\n")
.to_string(); .to_string();
@ -115,7 +115,7 @@ impl Msg {
sanitized_html sanitized_html
} else { } else {
let sanitized_plain = Regex::new(r"(\r?\n *){2,}") let sanitized_plain = Regex::new(r"(\r?\n[\t ]*){2,}")
.unwrap() .unwrap()
.replace_all(&plain, "\n\n") .replace_all(&plain, "\n\n")
.to_string(); .to_string();