mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
comment some preview regexes
This commit is contained in:
parent
1ea27d7020
commit
196a9c167d
@ -2705,13 +2705,21 @@ public class LocalStore extends Store implements Serializable {
|
||||
text = text.substring(0, 8192);
|
||||
}
|
||||
|
||||
|
||||
// try to remove lines of dashes in the preview
|
||||
text = text.replaceAll("(?m)^----.*?$", "");
|
||||
// remove quoted text from the preview
|
||||
text = text.replaceAll("(?m)^[#>].*$", "");
|
||||
// Remove a common quote header from the preview
|
||||
text = text.replaceAll("(?m)^On .*wrote.?$", "");
|
||||
// Remove a more generic quote header from the preview
|
||||
text = text.replaceAll("(?m)^.*\\w+:$", "");
|
||||
|
||||
// URLs in the preview should just be shown as "..." - They're not
|
||||
// clickable and they usually overwhelm the preview
|
||||
text = text.replaceAll("https?://\\S+", "...");
|
||||
// Don't show newlines in the preview
|
||||
text = text.replaceAll("(\\r|\\n)+", " ");
|
||||
// Collapse whitespace in the preview
|
||||
text = text.replaceAll("\\s+", " ");
|
||||
if (text.length() <= 512) {
|
||||
return text;
|
||||
|
Loading…
Reference in New Issue
Block a user