badwords
badwords copied to clipboard
Can not filter \n\n\n\n
I am allowing users to send multiple lines in a chat. When a user sends nothing but empty lines, the filter breaks, and throws Uncaught TypeError: Cannot read properties of null (reading '0') at Filter.clean.
More broadly, this happens when the characters are all whitespace (eg ) or the string is empty.