apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.68k stars 349 forks source link

Show parseStyleAttributes warning in browser only #614

Closed mog422 closed 1 year ago

mog422 commented 1 year ago

Summary

See issue #613

What are the specific steps to test this change?

  1. Execute require(".")("<div style='invalid style'></div>", { allowedAttributes: { div: [ 'style' ] } }) in node
  2. Make sure no warnings are displayed.
  3. Execute same code in browser
  4. Check if warning is displayed.

What kind of change does this PR introduce?

(Check at least one)

Make sure the PR fulfills these requirements:

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information: