JSFiddle - React, Tailwind, and code Playground
JavaScript
var text = 'Some text...<div class=example><pre><ul><li>Item</li></ul></pre><div class=showExample></div></div>Some text...';
match = text.match(/<pre>(.*?)<\/pre>/)[1];
match = match.replace(/</g, '<').replace(/>/g, '>');
text = text.replace(/<pre>.*?<\/pre>/, '<pre>'+match+'</pre>');
alert(text);