diff --git a/src/com/android/email/mail/store/LocalStore.java b/src/com/android/email/mail/store/LocalStore.java index ee7556a0b..48b6629ab 100644 --- a/src/com/android/email/mail/store/LocalStore.java +++ b/src/com/android/email/mail/store/LocalStore.java @@ -2020,10 +2020,8 @@ public class LocalStore extends Store implements Serializable } text = buff.toString(); text = text.replaceAll("\\s*([-=_]{30,}+)\\s*","
"); - text = text.replaceAll("(?m)^(.{50,}[\\w,:;+/])\\s*[\r\n]{1,4}(?!\\W)","$1 "); - - text = text.replaceAll("(?m)[\r\n]{3,}","\n\n"); - + text = text.replaceAll("(?m)^([^\r\n]{4,}[\\s\\w,:;+/])(?:\r\n|\n|\r)(?=[a-z]\\S{0,10}[\\s\\n\\r])","$1 "); + text = text.replaceAll("(?m)(\r\n|\n|\r){4,}","\n\n"); Matcher m = Regex.WEB_URL_PATTERN.matcher(text); StringBuffer sb = new StringBuffer(text.length() + 512);