Hi,
Unfortunately the removal of <br /> is needed. Joomla automatically converts new lines (\n) into <br /> tags. So you cannot tell if the <br /> is added by Joomla (which would corrupt PHP code, and xHTML which uses block level elements for layout) or intended.
So all <br /> is removed.
The other option with mod PHP would be to parse the PHP code - either with the tokenizer or regular expressions, and decide which <br /> is intended and which isn't, which would be unnecessary overhead 99% of the time. It still doesn't solve the unintended <br /> tags in xHTML however.
The other option is to style your <p> tags with CSS. Add the styling you need.
eg:
<div class="my_custom_content">
<p>Some text</p>
<p>Some text</p>
</div>
and in CSS
div.my_custom_content p {
margin:0;
padding:5px 2px;
}
Notice I'm using the CSS selector:
div.my_custom_content p
instead of just
p
So we do not select all the other <p> tags in the document. Just that inside the div
<div class="my_custom_content">