Closed mog422 closed 1 year ago
I agree this is not great. Fortunately it is easy to detect the browser. Would you like to send a PR?
if (typeof window === 'undefined')
// this is node
I think this is safer than checking the other way around because it would be nice not to break alternatives to Node.
I sent PR
The problem to solve
https://github.com/apostrophecms/sanitize-html/blob/25869acb40033803f2c337d7bc6fbf628a030fd9/index.js#L454
Even when normally using check arbitrary user input on the server side, Log spam occurs whenever user inputs an invalid style.
Proposed solution
Add option to remove warning
Alternatives
Only print warning whe actually running in the browser environment.
Additional context