sanitize-html icon indicating copy to clipboard operation
sanitize-html copied to clipboard

linear-gradient in background style property seems to breaks the whole property

Open srenoufd opened this issue 9 months ago • 7 comments

Using the latest version of the package, it seems that linear-gradient in combination with url(), set in the background inside an inline style property will break the background.

Steps to reproduce :

  1. Use CSS property & value : background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(any_url) no-repeat center center; in any html tag
  2. Pass it to the sanitize function
  3. The selected tag will have its background property entirely removed.

Are there any workaround ?

srenoufd avatar Mar 25 '25 13:03 srenoufd