Skip to content

Stripping off the contents when Child Combinator are present in the media queries  #251

Closed
@log2akshat

Description

@log2akshat

Hi,

We are using this library in Zimbra for sanitization of the e-mail body and during sanitization of the customer-generated HTML, we came across the following situation when we have Child Combinator in the media queries and during sanitization, it is not able to parse properly and the whole HTML is stripped off.

@media yahoo {
               .d-mobile {
                  display: none !important;
               }

               .d-desktop {
                  display: block !important;
               }

               .w-lg-75>tbody>tr>td {
                  width: 75% !important;
               }

               .w-lg-100 {
                  width: 100% !important;
               }

               .w-lg-100>tbody>tr>td {
                  width: 100% !important;
               }

               .pt-lg-0>tbody>tr>td,
               .py-lg-0>tbody>tr>td {
                  padding-top: 0 !important;
               }

               .pr-lg-0>tbody>tr>td,
               .px-lg-0>tbody>tr>td {
                  padding-right: 0 !important;
               }

               .pb-lg-0>tbody>tr>td,
               .py-lg-0>tbody>tr>td {
                  padding-bottom: 0 !important;
               }

               .pl-lg-0>tbody>tr>td,
               .px-lg-0>tbody>tr>td {
                  padding-left: 0 !important;
               }
.....

It works fine if I pull the Child Combiator out of the media query I got the following message but it is able to perform sanitization without stripping off the contents.

Child:[style: null]
Next Child:null

It will be great if someone can guide me on how to handle this situation or it can be considered as an enhancement or bugfix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions