mirror of https://github.com/M66B/FairEmail.git
Normalize html line breaks
This commit is contained in:
parent
69fbc51b8e
commit
081d25940a
|
@ -148,7 +148,7 @@ public class ActivityEml extends ActivityBase {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
for (MessageHelper.AttachmentPart apart : parts.getAttachmentParts()) {
|
||||
if (sb.length() > 0)
|
||||
sb.append("<br />");
|
||||
sb.append("<br>");
|
||||
sb.append(apart.part.getContentType());
|
||||
if (apart.disposition != null)
|
||||
sb.append(' ').append(apart.disposition);
|
||||
|
|
|
@ -327,7 +327,7 @@ public class EmailProvider {
|
|||
if (title == null)
|
||||
title = "";
|
||||
else
|
||||
title += "<br />";
|
||||
title += "<br>";
|
||||
title += xml.getText();
|
||||
}
|
||||
continue;
|
||||
|
@ -481,7 +481,7 @@ public class EmailProvider {
|
|||
if (provider.documentation == null)
|
||||
provider.documentation = new StringBuilder();
|
||||
else
|
||||
provider.documentation.append("<br /><br />");
|
||||
provider.documentation.append("<br><br>");
|
||||
|
||||
provider.documentation.append("<a href=\"").append(href).append("\">").append(title).append("</a>");
|
||||
}
|
||||
|
|
|
@ -612,7 +612,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
String ref = Helper.readText(refFile);
|
||||
String plain = HtmlHelper.getText(ref);
|
||||
String html = "<p>" + plain.replaceAll("\\r?\\n", "<br />") + "</p>";
|
||||
String html = "<p>" + plain.replaceAll("\\r?\\n", "<br>") + "</p>";
|
||||
|
||||
try (BufferedWriter out = new BufferedWriter(new FileWriter(file))) {
|
||||
out.write(body);
|
||||
|
@ -2041,7 +2041,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
draft.subject = args.getString("subject", "");
|
||||
body = args.getString("body", "");
|
||||
body = body.replaceAll("\\r?\\n", "<br />");
|
||||
body = body.replaceAll("\\r?\\n", "<br>");
|
||||
|
||||
if (answer > 0) {
|
||||
EntityAnswer a = db.answer().getAnswer(answer);
|
||||
|
|
|
@ -3829,7 +3829,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
int end = body.indexOf(PGP_END_MESSAGE);
|
||||
if (begin >= 0 && begin < end) {
|
||||
String section = body.substring(begin, end + PGP_END_MESSAGE.length());
|
||||
String[] lines = section.split("<br />");
|
||||
String[] lines = section.split("<br>");
|
||||
List<String> disarmored = new ArrayList<>();
|
||||
for (String line : lines)
|
||||
if (!TextUtils.isEmpty(line) && !line.contains(": "))
|
||||
|
|
|
@ -152,7 +152,7 @@ public class HtmlHelper {
|
|||
|
||||
// Pre formatted text
|
||||
for (Element code : document.select("pre")) {
|
||||
code.html(code.html().replaceAll("\\r?\\n", "<br />"));
|
||||
code.html(code.html().replaceAll("\\r?\\n", "<br>"));
|
||||
code.tagName("div");
|
||||
}
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ public class Log {
|
|||
sb.append(ex.toString()).append("\n").append(android.util.Log.getStackTraceString(ex));
|
||||
if (log != null)
|
||||
sb.append(log);
|
||||
String body = "<pre>" + sb.toString().replaceAll("\\r?\\n", "<br />") + "</pre>";
|
||||
String body = "<pre>" + sb.toString().replaceAll("\\r?\\n", "<br>") + "</pre>";
|
||||
|
||||
EntityMessage draft;
|
||||
|
||||
|
|
|
@ -864,7 +864,7 @@ public class MessageHelper {
|
|||
|
||||
if (part.isMimeType("text/plain")) {
|
||||
result = TextUtils.htmlEncode(result);
|
||||
result = result.replaceAll("\\r?\\n", "<br />");
|
||||
result = result.replaceAll("\\r?\\n", "<br>");
|
||||
result = "<span>" + result + "</span>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue