mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Remove horizontal rules in message previews.
This commit is contained in:
parent
edf4a0f86d
commit
7e26b62227
@ -2794,6 +2794,8 @@ public class LocalStore extends Store implements Serializable {
|
||||
text = text.replaceAll("(?m)^On .*wrote.?$", "");
|
||||
// Remove a more generic quote header from the preview
|
||||
text = text.replaceAll("(?m)^.*\\w+:$", "");
|
||||
// Remove horizontal rules.
|
||||
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", " ");
|
||||
|
||||
// URLs in the preview should just be shown as "..." - They're not
|
||||
// clickable and they usually overwhelm the preview
|
||||
@ -2802,6 +2804,9 @@ public class LocalStore extends Store implements Serializable {
|
||||
text = text.replaceAll("(\\r|\\n)+", " ");
|
||||
// Collapse whitespace in the preview
|
||||
text = text.replaceAll("\\s+", " ");
|
||||
// Remove any whitespace at the beginning and end of the string.
|
||||
text = text.trim();
|
||||
|
||||
if (text.length() <= 512) {
|
||||
return text;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user