I am doing some processing with JSOUP (element removal), but I see some unwanted side effect. I have custom element <my-element/>
and when I process it with JSOUP it becomes <my-element />
. So unwanted space is added at the end. I can deal with that, but it would ideal for me to avoid this.
My removal code looks like this:
Document html = Jsoup.parse(c);
Element toRemove = html.select(".to-remove").first();
if (toRemove != null) {
toRemove.remove();
}
String result = html.outerHtml();
How can I configure JSOUP so it does not touch other than removed elements?