JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
<pre id="mypre" style="background-color:grey"></pre>
JavaScript
var val = `"<!DOCTYPE html>\n
<html>
\n
<body>
\n
<h1>My First Heading</h1>
\n
<p>My first paragraph.</p>
\n\n
</body>
\n
</html>
"`;
$(document).ready(function(){
val = val.replace(/^"(.*)"$/, '$1');
val = val.replace(/(?:\r\n|\r|\n)/g, '');
$("#mypre").text(val);
});