title: Node js .I want to use markdown to save the data securely(for xss) instead of json.stringify() method
body: <p>I want to use markdown  to save the data securely  instead of json.stringfy() method.Like this exapmle:usercomment is <code>&lt;script&gt;alert('ss')&lt;/script&gt;</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.get('/comment',function(req.res){
  var usercomment=req.body.comment;//from comment textarea(user's comment)
  const x=markdown.toHTML(usercomment);
  var comments=new comment({user:req.session.nick,comment:x});
  comments.save();
  console.log(x)
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Or use json.stringify() like this  <strong>I save the usercomment with json.stringify().Later i will send the comment(from database) to html with markdown.toHTML(comment)</strong>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.get('/comment',function(req.res){
  var usercomment=req.body.comment;
      const x=JSON.stringify(usercomment);
      var comments=new comment({user:req.session.nick,comment:x});
      comments.save();
      console.log(x)
  
      }</code></pre>
  </div>
  </div>
  
  <strong>Which one should I use?</strong></p>