Ich habe einen Beispielcode wie folgt.Vermeiden Sie das Entfernen von Leerzeichen und Zeilenumbruch beim Parsen von HTML mit jsoup
String sample = "<html>
<head>
</head>
<body>
This is a sample on parsing html body using jsoup
This is a sample on parsing html body using jsoup
</body>
</html>";
Document doc = Jsoup.parse(sample);
String output = doc.body().text();
ich die Ausgabe als
This is a sample on parsing html body using jsoup This is a sample on `parsing html body using jsoup`
Aber ich möchte, dass die Ausgabe als
This is a sample on parsing html body using jsoup
This is a sample on parsing html body using jsoup
Wie es tun analysieren, so dass ich diese Ausgabe erhalten? Oder gibt es eine andere Möglichkeit, dies in Java zu tun?