title: Split a string (that contains tags) by spaces without breaking the tags or tag inner html in Javascript
body: <p>I'm attempting to split a string by spaces into an array of words. If the string contains HTML tags, I would like the full tag (including content) to be treated as a single word.</p>
  
  <p>For example,</p>
  
  <pre><code>I like to eat &lt;a href="http://www.waffles.com/"&gt;tasty delicious waffles&lt;/a&gt; for breakfast
  </code></pre>
  
  <p>should split into</p>
  
  <pre><code>I
  like
  to
  eat
  &lt;a href="http://www.waffles.com/"&gt;tasty delicious waffles&lt;/a&gt;
  for
  breakfast
  </code></pre>
  
  <p>I've seen a couple related threads on Stack Overflow but I'm having trouble adapting anything to Javascript because they were written for languages that I'm not quite familiar with. Is there a regex expression that could easily do this or will the solution require multiple regex splits and iteration?</p>
  
  <p>Thanks. </p>