title: Javascript replace two consecutive tags
body: <p>I am building a React app and I'm having the following issue:
  My text editor fails at some html syntaxes. The package isn't very good itself so yeah.</p>
  
  <p>What I am trying to achieve is transform the following syntax
  <code>&lt;p&gt;&lt;p&gt; hey &lt;/p&gt;&lt;/p&gt;</code> into <code>&lt;p&gt; hey &lt;/p&gt;</code></p>
  
  <p>I tried to do something like <code>text.replace(/&lt;p&gt;&lt;p&gt;/g, '&lt;p&gt;')</code> but it is not a valid syntax.</p>