Fixed clearing annotations

This commit is contained in:
M66B
2020-12-19 20:12:22 +01:00
parent bbd66a22bb
commit 19e232061f
2 changed files with 33 additions and 20 deletions

View File

@@ -328,20 +328,7 @@ public class HtmlHelper {
static Document sanitizeCompose(Context context, String html, boolean show_images) {
try {
Document d = sanitize(context, JsoupEx.parse(html), false, show_images);
d.select("*")
.removeAttr("x-block")
.removeAttr("x-inline")
.removeAttr("x-paragraph")
.removeAttr("x-font-size")
.removeAttr("x-font-size-rel")
.removeAttr("x-line-before")
.removeAttr("x-line-after")
.removeAttr("x-align")
.removeAttr("x-column")
.removeAttr("x-dashed")
.removeAttr("x-tracking");
return d;
return sanitize(context, JsoupEx.parse(html), false, show_images);
} catch (Throwable ex) {
// OutOfMemoryError
Log.e(ex);
@@ -2520,6 +2507,21 @@ public class HtmlHelper {
return ssb;
}
static void clearAnnotations(Document d) {
d.select("*")
.removeAttr("x-block")
.removeAttr("x-inline")
.removeAttr("x-paragraph")
.removeAttr("x-font-size")
.removeAttr("x-font-size-rel")
.removeAttr("x-line-before")
.removeAttr("x-line-after")
.removeAttr("x-align")
.removeAttr("x-column")
.removeAttr("x-dashed")
.removeAttr("x-tracking");
}
static Spanned fromHtml(@NonNull String html, Context context) {
return fromHtml(html, null, null, context);
}