Small improvements

This commit is contained in:
M66B
2018-12-14 20:15:07 +01:00
parent e0dc8ffb96
commit 627ce9e7a0
3 changed files with 31 additions and 10 deletions

View File

@@ -51,6 +51,10 @@ import java.util.regex.Pattern;
public class HtmlHelper {
private static Pattern pattern = Pattern.compile("([http|https]+://[\\w\\S(\\.|:|/)]+)");
static String getBody(String html) {
return Jsoup.parse(html).body().html();
}
static String sanitize(String html) {
Document document = Jsoup.parse(Jsoup.clean(html, Whitelist
.relaxed()
@@ -97,6 +101,7 @@ public class HtmlHelper {
public void tail(Node node, int depth) {
}
}, document.body());
return document.body().html();
}