Hi everyone,
I need a way to remove extra paragraphs and <br /> in a textarea.
it could appear as:
<br />
<p> </p>
<br />
<p> </p>
<p> </p>
or
<br />
<p> </p>
<p> </p>
<br />
and i need a way to remove all extra <br /> as i have seen this posting into the db as well:
<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />
removing empty paragraphs and limit <br />
Moderator: General Moderators
Re: removing empty paragraphs and limit <br />
use margin: 0; to remove the spaces between paragraphs or empty paragraphs.
p { margin: 0; }
or
p { margin: 0 !important; }
p { margin: 0; }
or
p { margin: 0 !important; }
Re: removing empty paragraphs and limit <br />
Give your users a WYSIWYG and this sort of thing becomes inevitable. You can try to strip out the <p> </p> using regex or str_replace or something, but "extra" <br>, especially with a WYSIWYG, is going to be a tougher nut to crack. What problems is it causing?