mirror of https://github.com/M66B/FairEmail.git
Fixed/improved pre processing
This commit is contained in:
parent
a8a5ed99a1
commit
c5c121e6a1
|
@ -233,6 +233,9 @@ public class HtmlHelper {
|
|||
}
|
||||
}
|
||||
|
||||
if (sb.length() == 0)
|
||||
span.removeAttr("style");
|
||||
else
|
||||
span.attr("style", sb.toString());
|
||||
}
|
||||
}
|
||||
|
@ -255,10 +258,10 @@ public class HtmlHelper {
|
|||
|
||||
// Pre formatted text
|
||||
for (Element pre : document.select("pre")) {
|
||||
Element div = document.createElement("div");
|
||||
Element div = document.createElement("font");
|
||||
div.attr("face", "monospace");
|
||||
|
||||
for (TextNode tnode : pre.textNodes()) {
|
||||
String[] lines = tnode.getWholeText().split("\\r?\\n");
|
||||
String[] lines = pre.wholeText().split("\\r?\\n");
|
||||
for (String line : lines) {
|
||||
line = Html.escapeHtml(line);
|
||||
|
||||
|
@ -277,8 +280,6 @@ public class HtmlHelper {
|
|||
span.html(sb.toString());
|
||||
div.appendChild(span);
|
||||
div.appendElement("br");
|
||||
Log.i("span html=" + span.html());
|
||||
}
|
||||
}
|
||||
|
||||
pre.replaceWith(div);
|
||||
|
|
Loading…
Reference in New Issue