From 134af358e3825d37fceae640a64374bc8d777811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Tue, 1 Feb 2022 17:10:23 +0100 Subject: [PATCH] remove also tabs from text parts (#280) --- src/domain/msg/msg_entity.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/msg/msg_entity.rs b/src/domain/msg/msg_entity.rs index 145a945..57c0e4a 100644 --- a/src/domain/msg/msg_entity.rs +++ b/src/domain/msg/msg_entity.rs @@ -106,7 +106,7 @@ impl Msg { .replace_all(&sanitized_html, " ") .to_string(); // Merge new line chars - let sanitized_html = Regex::new(r"(\r?\n *){2,}") + let sanitized_html = Regex::new(r"(\r?\n[\t ]*){2,}") .unwrap() .replace_all(&sanitized_html, "\n\n") .to_string(); @@ -115,7 +115,7 @@ impl Msg { sanitized_html } else { - let sanitized_plain = Regex::new(r"(\r?\n *){2,}") + let sanitized_plain = Regex::new(r"(\r?\n[\t ]*){2,}") .unwrap() .replace_all(&plain, "\n\n") .to_string();