1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Remove horizontal rules in message previews.

This commit is contained in:
Andrew Chen 2012-04-08 16:52:55 -07:00
parent edf4a0f86d
commit 7e26b62227

View File

@ -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 {