JSFiddle - React, Tailwind, and code Playground

by Gabriele Petrioli

JavaScript

error_text = 'this is < cool " beans >';
alert('before\n' + error_text);
// Replace all &lt; and &gt; by < and >
  error_text = error_text.replace(/&(lt|gt|quot);/g, function (m, p) { 
      console.log(p);
    return (p == "lt") ? "<" : ((p == "gt") ? ">" : "'");
  });


alert('after\n' + error_text);