Understand XSS safety in striptags
mainBy default, striptags is safe to use as text within an HTML tag because it removes all potential XSS vectors.
Warning: This safety guarantee is removed if you specify either allowedTags or disallowedTags. A malicious user can still achieve XSS via attributes in an allowed tag, such as <img onload="alert(1);">.
Additionally, striptags automatically HTML encodes < and > characters followed by whitespace to prevent them from being interpreted as tags by browsers. You can disable this via encodePlaintextTagDelimiters: false if the output is intended for plaintext-only environments.