Html: refactoring

pull/214/head
M66B 12 months ago
parent 5cd8f50965
commit 1c5ba52048

@ -351,9 +351,9 @@ public class ActivityCode extends ActivityBase {
if (sanitize) { if (sanitize) {
List<CSSStyleSheet> sheets = List<CSSStyleSheet> sheets =
HtmlHelper.parseStyles(d.head().select("style")); HtmlSanitize.parseStyles(d.head().select("style"));
for (Element element : d.select("*")) { for (Element element : d.select("*")) {
String computed = HtmlHelper.processStyles(context, String computed = HtmlSanitize.processStyles(context,
element.tagName(), element.tagName(),
element.className(), element.className(),
element.attr("style"), element.attr("style"),

@ -5924,11 +5924,11 @@ public class FragmentCompose extends FragmentBase {
Element e = d.body(); Element e = d.body();
// Apply styles // Apply styles
List<CSSStyleSheet> sheets = HtmlHelper.parseStyles(d.head().select("style")); List<CSSStyleSheet> sheets = HtmlSanitize.parseStyles(d.head().select("style"));
for (Element element : e.select("*")) { for (Element element : e.select("*")) {
String tag = element.tagName(); String tag = element.tagName();
String clazz = element.attr("class"); String clazz = element.attr("class");
String style = HtmlHelper.processStyles(context, tag, clazz, null, sheets); String style = HtmlSanitize.processStyles(context, tag, clazz, null, sheets);
style = HtmlHelper.mergeStyles(style, element.attr("style")); style = HtmlHelper.mergeStyles(style, element.attr("style"));
if (!TextUtils.isEmpty(style)) if (!TextUtils.isEmpty(style))
element.attr("style", style); element.attr("style", style);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save