1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

text->html now does a better job converting

---------------------------------------------------------
This commit is contained in:
Jesse Vincent 2009-11-28 04:56:47 +00:00
parent cdf0693e27
commit 46ddc7d8e5

View File

@ -1993,6 +1993,7 @@ public class LocalStore extends Store implements Serializable
Log.e(Email.LOG_TAG, null, e); Log.e(Email.LOG_TAG, null, e);
} }
text = buff.toString(); text = buff.toString();
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*","<hr />");
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);
@ -2009,6 +2010,10 @@ public class LocalStore extends Store implements Serializable
m.appendReplacement(sb, "$0"); m.appendReplacement(sb, "$0");
} }
} }
m.appendTail(sb); m.appendTail(sb);
sb.append("</pre></body></html>"); sb.append("</pre></body></html>");
text = sb.toString(); text = sb.toString();