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.?$", "");
|
text = text.replaceAll("(?m)^On .*wrote.?$", "");
|
||||||
// Remove a more generic quote header from the preview
|
// Remove a more generic quote header from the preview
|
||||||
text = text.replaceAll("(?m)^.*\\w+:$", "");
|
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
|
// URLs in the preview should just be shown as "..." - They're not
|
||||||
// clickable and they usually overwhelm the preview
|
// clickable and they usually overwhelm the preview
|
||||||
@ -2802,6 +2804,9 @@ public class LocalStore extends Store implements Serializable {
|
|||||||
text = text.replaceAll("(\\r|\\n)+", " ");
|
text = text.replaceAll("(\\r|\\n)+", " ");
|
||||||
// Collapse whitespace in the preview
|
// Collapse whitespace in the preview
|
||||||
text = text.replaceAll("\\s+", " ");
|
text = text.replaceAll("\\s+", " ");
|
||||||
|
// Remove any whitespace at the beginning and end of the string.
|
||||||
|
text = text.trim();
|
||||||
|
|
||||||
if (text.length() <= 512) {
|
if (text.length() <= 512) {
|
||||||
return text;
|
return text;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user