Closed piu130 closed 3 months ago
I did not find an easy solution so far. Our current workaround (with org.jsoup:jsoup:1.15.4, simplified):
var fixedMailBody = mailBody // org.jsoup.nodes.Document
.select("ul li,ol li")
.forEach(li -> {
var text = li.text();
var matcher = Pattern.compile("^(\\*|\\d+\\.) (?<text>.*)").matcher(text);
if (matcher.find()) {
li.text(matcher.group("text"));
}
})
.html();
This bug should be fixed now, in v1.14.1
When parsing lists in msgs, the resulting html (
.getHTMLText()
) contains the list tag as well as the bullet point in text. The browser renders a bullet point, because of the list tag and a second bullet point from the text.Outlook: Browser: HTML:
We should remove the
*
and the1.
(and tab?) from the html text. Otherwise we can also fix this on our side by replacingtype=disc
withtype=none
or removing the first (two) char(s) in the list.What do you think?