Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1091e7af authored by Joe Steele's avatar Joe Steele
Browse files

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 commits 1ea27d70 and
e12dd323.

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.
parent 1f5e1660
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -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());