Reputation: 18009
I want to use markdown in a website, I'm wondering about convert markdown to HTML client side or server side. I'll use https://github.com/evilstreak/markdown-js that has both client/server libraries. (node.js)
I never used markdown before and I'm wondering about the efficience of the two ways, the security too, because I don't want to have html tags from users (injections)
Do you have any advice or explanation about why do it client side or server side? Thanks.
Upvotes: 2
Views: 1373
Reputation: 12275
If you're looking for efficiency, you should use the same module to render at both server-side and client-side.
Server side rendering is needed for initial request, and if your data is updated somehow by user, it needs to be re-rendered at the client-side.
Reasons:
Upvotes: 5