mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-22 15:55:57 +00:00
Clear columns with non breaking spaces
This commit is contained in:
parent
687251c62c
commit
150e7d5669
1 changed files with 14 additions and 0 deletions
|
@ -833,6 +833,20 @@ public class HtmlHelper {
|
|||
// Tables
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table
|
||||
for (Element col : document.select("th,td")) {
|
||||
// Clear columns with non breaking spaces
|
||||
if (col.childNodeSize() == 1 &&
|
||||
col.childNode(0) instanceof TextNode) {
|
||||
boolean nbsp = true;
|
||||
String text = ((TextNode) col.childNode(0)).getWholeText();
|
||||
for (int i = 0; i < text.length(); i++)
|
||||
if (text.charAt(i) != '\u00a0') {
|
||||
nbsp = false;
|
||||
break;
|
||||
}
|
||||
if (nbsp)
|
||||
col.html("");
|
||||
}
|
||||
|
||||
// separate columns
|
||||
if (hasVisibleContent(col.childNodes()))
|
||||
if (col.nextElementSibling() != null)
|
||||
|
|
Loading…
Reference in a new issue