From 61a5db408d9ef3f5146d9c8c9a3c5c5a494e239c Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 26 Aug 2023 17:41:51 +0200 Subject: [PATCH] Process all element classes --- .../main/java/eu/faircode/email/HtmlHelper.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index d6058f30a9..f38cc05db8 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -1798,11 +1798,18 @@ public class HtmlHelper { style = mergeStyles(style, srule.getStyle().getCssText(), false); break; case Selector.SAC_CONDITIONAL_SELECTOR: - ConditionalSelectorImpl cselector = (ConditionalSelectorImpl) selector; - if (cselector.getCondition().getConditionType() == SAC_CLASS_CONDITION) { - ClassConditionImpl ccondition = (ClassConditionImpl) cselector.getCondition(); - if (clazz.equalsIgnoreCase(ccondition.getValue())) - style = mergeStyles(style, srule.getStyle().getCssText(), false); + if (!TextUtils.isEmpty(clazz)) { + ConditionalSelectorImpl cselector = (ConditionalSelectorImpl) selector; + if (cselector.getCondition().getConditionType() == SAC_CLASS_CONDITION) { + ClassConditionImpl ccondition = (ClassConditionImpl) cselector.getCondition(); + String value = ccondition.getValue(); + for (String cls : clazz.split("\\s+")) + if (cls.equalsIgnoreCase(value)) { + style = mergeStyles(style, srule.getStyle().getCssText(), false); + break; + } + + } } break; }