mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Parse name="quote" divs (#2104)
fix #1560 Replies in html-only format are not converted nicely wrt Quoting
This commit is contained in:
@@ -91,6 +91,14 @@ pub fn simplify(mut input: String, is_chat_message: bool) -> (String, bool, Opti
|
||||
render_message(lines, has_nonstandard_footer || bottom_quote.is_some())
|
||||
}
|
||||
};
|
||||
|
||||
if !is_chat_message {
|
||||
top_quote = top_quote.map(|quote| {
|
||||
let quote_lines = split_lines("e);
|
||||
let quote_lines = remove_message_footer("e_lines);
|
||||
render_message(quote_lines, false)
|
||||
});
|
||||
}
|
||||
(text, is_forwarded, top_quote)
|
||||
}
|
||||
|
||||
@@ -218,19 +226,10 @@ fn render_message(lines: &[&str], is_cut_at_end: bool) -> String {
|
||||
* Tools
|
||||
*/
|
||||
fn is_empty_line(buf: &str) -> bool {
|
||||
// XXX: can it be simplified to buf.chars().all(|c| c.is_whitespace())?
|
||||
//
|
||||
// Strictly speaking, it is not equivalent (^A is not whitespace, but less than ' '),
|
||||
// but having control sequences in email body?!
|
||||
//
|
||||
// See discussion at: https://github.com/deltachat/deltachat-core-rust/pull/402#discussion_r317062392
|
||||
for c in buf.chars() {
|
||||
if c > ' ' {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
true
|
||||
buf.chars().all(char::is_whitespace)
|
||||
// for some time, this checked for `char <= ' '`,
|
||||
// see discussion at: https://github.com/deltachat/deltachat-core-rust/pull/402#discussion_r317062392
|
||||
// and https://github.com/deltachat/deltachat-core-rust/pull/2104/files#r538973613
|
||||
}
|
||||
|
||||
fn is_quoted_headline(buf: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user