mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 03:32:16 -05:00
Eliminate non-working text replacements
All \r and \n codes have been replaced with <br />, so the patterns in these replacements don't match anything. This problem has existed for some time -- since commits1ea27d7
ande12dd32
. No attempt is made here to reimplement the replacements because users are now used to the current behavior without much apparent complaint, and such replacements are never perfect and can occasionally fail to work as desired without additional tweaking for special cases.
This commit is contained in:
parent
1f5e1660a8
commit
1091e7af99
@ -282,17 +282,6 @@ public class HtmlConverter {
|
||||
// Replace lines of -,= or _ with horizontal rules
|
||||
text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", "<hr />");
|
||||
|
||||
/*
|
||||
* Unwrap multi-line paragraphs into single line paragraphs that are
|
||||
* wrapped when displayed. But try to avoid unwrapping consecutive lines
|
||||
* of text that are not paragraphs, such as lists of system log entries
|
||||
* or long URLs that are on their own line.
|
||||
*/
|
||||
text = text.replaceAll("(?m)^([^\r\n]{4,}[\\s\\w,:;+/])(?:\r\n|\n|\r)(?=[a-z]\\S{0,10}[\\s\\n\\r])", "$1 ");
|
||||
|
||||
// Compress four or more newlines down to two newlines
|
||||
text = text.replaceAll("(?m)(\r\n|\n|\r){4,}", "\r\n\r\n");
|
||||
|
||||
StringBuffer sb = new StringBuffer(text.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH);
|
||||
|
||||
sb.append(htmlifyMessageHeader());
|
||||
|
Loading…
Reference in New Issue
Block a user