title: NodeJS Express how to unescape HTML entities for display purposes
body: <p>I am building a web application in NodeJS with Express, Angular JS and Google App-Engine Datastore.</p>
  
  <p>I am learning Node. I created a form that "sanitizes" (escapes) user input before inserting into the database. I followed the NodeJS tutorial on the MDN website to create this code:</p>
  
  <pre><code>//Trim and escape all inputs
  req.sanitize('requester').escape();
  req.sanitize('requester').trim();
  req.sanitize('dataowner').escape();
  req.sanitize('dataowner').trim();
  req.sanitize('requested_filepath_list').escape();
  req.sanitize('requested_filepath_list').trim();
  </code></pre>
  
  <p>The 'requested_filepath_list' is a list of UNIX file paths.</p>
  
  <p>So when a user submits the request, it is stored in the database in the "Escaped" format.</p>
  
  <pre><code>//Escaped data
  &amp;#x2F;top&amp;#x2F;example&amp;#x2F;test123.txt
  </code></pre>
  
  <p>Question: How can I "unescape" the data for display purposes?</p>
  
  <pre><code>//Desired output
  /top/example/test123.txt
  </code></pre>
  
  <p>I tried the unescape function but it does not seem to work, it just returns the same output.</p>
  
  <pre><code>let escape_str = '&amp;#x2F;top&amp;#x2F;example&amp;#x2F;test123.txt';
  let unescaped_str = unescape(escape_str);
  console.log('unescaped_str: ' + unescaped_str);
  
  //Output
  unescaped_str: &amp;#x2F;top&amp;#x2F;example&amp;#x2F;test123.txt
  
  //Desired output
  /top/example/test123.txt
  </code></pre>