1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

huge improvements to render quality of plaintext messages.

This commit is contained in:
Jesse Vincent 2009-11-28 04:56:58 +00:00
parent 46ddc7d8e5
commit 96958569b0

View File

@ -1994,10 +1994,14 @@ public class LocalStore extends Store implements Serializable
}
text = buff.toString();
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*","<hr />");
text = text.replaceAll("(?m)^(.{50,}[\\w,:;+/])\\s*[\r\n]{1,4}(?!\\W)","$1 ");
text = text.replaceAll("(?m)[\r\n]{3,}","\n\n");
Matcher m = Regex.WEB_URL_PATTERN.matcher(text);
StringBuffer sb = new StringBuffer(text.length() + 512);
sb.append("<html><body><pre style=\"white-space: pre-wrap;\">");
sb.append("<html><body><pre style=\"white-space: pre-wrap; word-wrap:break-word; \">");
while (m.find())
{
int start = m.start();