html sanitizing library
Answered
`${ViNoS}` posted this in #help-forum
how to sanitize html in next? i tried DOMpurify but it's not working with next
Answered by `${ViNoS}`
at the end i found a library called
however i think this is not really secure (didn't read or test anything, just my personal opinion)
xss
, it works perfectly for my case since it's purely javascrpt functions and sanitization (i guess) however i think this is not really secure (didn't read or test anything, just my personal opinion)
3 Replies
you need to give more info here. sanitise html for what? how did you use DOMpurify and why did it not work?
yes i used DOMPurify
it did not work because it needs a DOM api to work with , this way it will error on the backend when pre-rendered (althought it gonna work but the page will be fully client side rendered, 0 html shipped )
you can make it work on the server side by using
it did not work because it needs a DOM api to work with , this way it will error on the backend when pre-rendered (althought it gonna work but the page will be fully client side rendered, 0 html shipped )
you can make it work on the server side by using
JSDom
package, but then it won't work at all since JSDOM doesen't work client sideat the end i found a library called
however i think this is not really secure (didn't read or test anything, just my personal opinion)
xss
, it works perfectly for my case since it's purely javascrpt functions and sanitization (i guess) however i think this is not really secure (didn't read or test anything, just my personal opinion)
Answer