Suppress more white space

This commit is contained in:
M66B 2019-06-30 09:51:43 +02:00
parent 1072edaa78
commit 655f0e3d3b
1 changed files with 12 additions and 1 deletions

View File

@ -188,6 +188,17 @@ public class HtmlHelper {
document.select("ul").tagName("div"); document.select("ul").tagName("div");
// Tables // Tables
for (Element div : document.select("div")) {
Element parent = div.parent();
while (parent != null) {
if ("td".equals(parent.tagName())) {
div.tagName("span"); // Prevent white space
break;
}
parent = parent.parent();
}
}
for (Element col : document.select("th,td")) { for (Element col : document.select("th,td")) {
// separate columns by a space // separate columns by a space
if (col.nextElementSibling() == null) { if (col.nextElementSibling() == null) {
@ -209,7 +220,7 @@ public class HtmlHelper {
for (Element table : document.select("table")) for (Element table : document.select("table"))
if (table.parent() != null && "a".equals(table.parent().tagName())) if (table.parent() != null && "a".equals(table.parent().tagName()))
table.tagName("span"); // // Links cannot contain tables table.tagName("span"); // Links cannot contain tables
else else
table.tagName("div"); table.tagName("div");