Context is a node express api, I'm using xss-clean on my main server.js file:
const xss = require('xss-clean');
// Prevent XSS attacks
app.use(xss());
Problem: I want to save rich text, but it's destroyed during sanitation.
I want to keep this functionality globally, however it prevents me from saving rich text via rich text editors on the front end (ie tiptap-vue). The text saved with editor contains html markup, which is escaped when saving to the database, and when pushed back out to the front end via a get request the text reads out with the escapes and the element's markup.
Is there a way to prevent this global component from working on one specific request, or specific data within a request?
or is there a way to un-escape it for use on the front end?