Small fix

This commit is contained in:
M66B 2020-02-14 16:57:09 +01:00
parent 8913b00652
commit 5870856402
1 changed files with 3 additions and 1 deletions

View File

@ -1198,11 +1198,13 @@ public class HtmlHelper {
}
static void cleanup(Document d) {
// https://www.chromestatus.com/feature/5756335865987072
// Some messages contain 100 thousands of Apple spaces
for (Element aspace : d.select(".Apple-converted-space")) {
Node next = aspace.nextSibling();
if (next instanceof TextNode) {
TextNode tnode = (TextNode) next;
tnode.text(tnode.text() + " ");
tnode.text(" " + tnode.text());
aspace.remove();
} else
aspace.replaceWith(new TextNode(" "));