mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 21:22:26 -05:00
huge improvements to render quality of plaintext messages.
This commit is contained in:
parent
46ddc7d8e5
commit
96958569b0
@ -1994,10 +1994,14 @@ public class LocalStore extends Store implements Serializable
|
|||||||
}
|
}
|
||||||
text = buff.toString();
|
text = buff.toString();
|
||||||
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*","<hr />");
|
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);
|
Matcher m = Regex.WEB_URL_PATTERN.matcher(text);
|
||||||
StringBuffer sb = new StringBuffer(text.length() + 512);
|
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())
|
while (m.find())
|
||||||
{
|
{
|
||||||
int start = m.start();
|
int start = m.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user