
JS web applications: parse user content on server or client side? - pram
In an Angular&#x2F;React type application, where should user content parsing be done? By that I mean adding links, images, youtube videos, markdown, etc.<p>I can see the benefit of doing it on the server side, if you&#x27;re serving from an API. You can generate the html and cache the response. The big problem with that though, as far as I can tell, is you have to render that html on the client side. Which means your server side parsing has to be very secure, or else your SPA will just render whatever the API gives it causing potential XSS issues.<p>Doing it on the client side happens every time and is less efficient (I guess) .. but presumably it would be easier to make sure content correctly gets parsed as an html element or textnode.
======
muhpirat
Hey,

Every time I have to parse user content, I make it o both. Client and Server
side.

