Given this HTML fragment:
<span>in span</span>
Text after span
parsing in 1.20.1 removes all of the whitespace between the end of the span tag and Text after span, leaving this:
<span>in span</span>Text after span
It should leave in at least one white space to be the same HTML:
<span>in span</span> Text after span
Failing test:
package foo;
import static org.jsoup.Jsoup.parse;
public class Jsoup {
public static void main(String[] args) {
var parsed = parse(
"""
<html>
<head></head>
<body>
<span>in span</span>
Text after span
</body>
</html>
""", "");
var expected =
"""
<html>
<head></head>
<body>
<span>in span</span> Text after span
</body>
</html>
""";
if (!parsed.toString().equals(expected)) {
throw new AssertionError("["+parsed+"] should be ["+expected+"]");
}
}
}
Given this HTML fragment:
parsing in 1.20.1 removes all of the whitespace between the end of the
spantag andText after span, leaving this:It should leave in at least one white space to be the same HTML:
Failing test: