handle nested or empty div elements

This commit is contained in:
CITE\spapacharalampous 2024-07-22 14:26:10 +03:00
parent 3d5acc9983
commit 045747fb6d
1 changed files with 5 additions and 0 deletions

View File

@ -278,6 +278,11 @@ public class HtmlToWorldBuilder implements NodeVisitor {
@Override
public void tail(Node node, int i) {
if (!node.outerHtml().contains("br")) {
String htmlToPlainText = Jsoup.parse(node.outerHtml()).text();
if (htmlToPlainText.trim().isEmpty()) return;
}
String name = node.nodeName();
properties.put(name, false);
parseProperties(node);