http://codepad.org/C18gmK1y
I want every knew line to be a paragraph. If a knew line is blank it should be ignored.
Code:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
Aenean eu dui ligula, et sodales arcu.
<p>Suspendisse id augue nec diam porta tristique.</p>
Should be
Code:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Aenean eu dui ligula, et sodales arcu.</p>
<p>Suspendisse id augue nec diam porta tristique.</p>
My regex is a bit naff. Has someone had to do this before? Been bugging me for a while.
EDIT: Never mind. Rewrote the regex and have it working correctly.