title: Convert youtube url to iframe and remove any surrounding html
body: <p>I'm trying to use the code below to convert a youtube URL to the embedded iframe code. The below is working fine, but the wysiwyg editor often adds <code>&lt;p&gt;</code> around plain text so a url such as </p>
  
  <pre><code>&lt;p&gt;https://www.youtube.com/watch?v=mJzHXFsU8UQ&lt;/p&gt;
  </code></pre>
  
  <p>will output as </p>
  
  <p><code>&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/mJzHXFsU9XX&amp;lt&lt;/p&gt;" frameborder="0" allowfullscreen=""&gt;&lt;/iframe&gt;</code></p>
  
  <p>How can I change the below so that it removes the <code>&lt;/p&gt;</code> from the src?</p>
  
  <pre><code>$('body').html(function(i, html) {
      return html.replace(/(?:https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g, '&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/$1" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;');
  });
  </code></pre>