Added detect HTML

This commit is contained in:
M66B
2023-01-19 08:53:23 +01:00
parent cc44993d1c
commit e29be73126
5 changed files with 47 additions and 7 deletions

View File

@@ -3829,12 +3829,6 @@ public class HtmlHelper {
.remove("x-keep-line");
}
static boolean isHtml(String text) {
Pattern p = Pattern.compile(".*\\<[^>]+>.*", Pattern.DOTALL);
boolean isHtml = p.matcher(text).matches();
return isHtml;
}
static Spanned fromHtml(@NonNull String html, Context context) {
Document document = JsoupEx.parse(html);
return fromDocument(context, document, null, null);