I made a little change to your code. Instead of adding and removing the event listeners in the javascript code, you can put data: { action: 'paste->trix-paste#pasteHandler' } into rich_text_area options.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this post.
I made a little change to your code. Instead of adding and removing the event listeners in the javascript code, you can put
data: { action: 'paste->trix-paste#pasteHandler' }
into rich_text_area options.