Normalize html line breaks

This commit is contained in:
M66B 2019-08-22 18:12:30 +02:00
parent 69fbc51b8e
commit 081d25940a
7 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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>");
}

View File

@ -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);

View File

@ -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(": "))

View File

@ -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");
}

View File

@ -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;

View File

@ -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>";
}