Skip to content

Feature request: Optional support for !important #221

Description

@ShwetaGhenand

Hi, thanks for the great library.

I understand that !important is removed by design for security reasons.
In our case, we’re sanitizing trusted HTML and only need !important for font-family.
Would it be possible to have an opt-in option for this, so the default behavior stays secure but we can enable it if needed?

Example:
HTML content (input):
<div style="font-family: Arial, sans-serif !important;"></div>

After sanitization (current behavior)
<div style="font-family: Arial, sans-serif"></div>

Expected behavior
<div style="font-family: Arial, sans-serif !important;"></div>

Thanks!

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