Line Break
-
I’m new to bbpress, and was playing around with an install. I noticed that it doesn’t allow all forms of line breaks, only the current proper one that is self closing.
<br> and <BR>
Do not seem to work properly. This was an issue because I noticed that my users are sloppy HTML coders and the tags would just print out.
I don’t know if it has been covered before. I searched and found nothing. I did get it to work with a small php tweak.
In formatting-functions.php, I put the following under bb_encode_bad:
$text = preg_replace('|& lt;BR& gt;|', '', $text);
$text = preg_replace('|& lt;br& gt;|', '', $text);
$text = preg_replace('|& lt;br /& gt;|', '', $text)(The code tag won’t output the code correctly, so I put a space after the &, so they wouldn’t get converted.)
It works, but all three forms now convert to
<br>
, instead ofWhich works well enough, but even self closing br tags will now drop the /
I’m not strong at PHP. Only enough to get by. What do you think. Is there another way to do it? Or a better way? Or hell, a plugin?
- You must be logged in to reply to this topic.