mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Fixed removing trailing block white space
This commit is contained in:
@@ -2244,10 +2244,6 @@ public class HtmlHelper {
|
||||
(i == 0 || endsWithSpace(block.get(i - 1).text())))
|
||||
text = text.substring(1);
|
||||
|
||||
// Conditionally remove trailing whitespace
|
||||
if (i == block.size() - 1 && endsWithSpace(text))
|
||||
text = text.substring(0, text.length() - 1);
|
||||
|
||||
tnode.text(text);
|
||||
|
||||
if (TextUtils.isEmpty(text))
|
||||
@@ -2256,6 +2252,20 @@ public class HtmlHelper {
|
||||
i++;
|
||||
}
|
||||
|
||||
// Remove trailing whitespace
|
||||
while (block.size() > 0) {
|
||||
tnode = block.get(block.size() - 1);
|
||||
text = tnode.getWholeText();
|
||||
if (endsWithSpace(text)) {
|
||||
text = text.substring(0, text.length() - 1);
|
||||
tnode.text(text);
|
||||
}
|
||||
if (TextUtils.isEmpty(text))
|
||||
block.remove(block.size() - 1);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
// Remove all blank blocks
|
||||
boolean blank = true;
|
||||
for (int i = 0; i < block.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user