MyBB Community Forums

Full Version: post HTML enabled, <table> tag causes extra <br />
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

At this forum of mine (using MyBB v1.4.11 in Turkish), when I post an HTML post containing a <table> tag, MyBB seems to add extra <br> tags between the start of the post and <table> tag.

The more <tr> 's the table has, the more the number of <br> tags being added.

How to prevent this, and could that be a bug?

Thanks.

Link to the forum: here
Generally enabling HTML in posts isn't a good idea for security reasons and also the practicality of it. A better solution would be to make custom MyCodes for the tags you need, for example make one [tr] that is replaced with <tr>
Thank you for the comment.

I've created two custom MyCodes now:

1- RegExp: \[TB\](.*?)\[/TB\] Replacement: <table>$1</table>
2- RegExp: \[TR\](.*?)\[/TR\] Replacement: <tr>$1</tr>

But this
[TB][TR]OK[/TR][/TB]
doesn't give out:

<table><tr>OK</tr></table>

But,

<table>[TB]OK[/TB]</table>

How to fix it?
There must be something wrong with your regular expression and unfortunately I don't know regular expressions very well. Someone else will probably help you out here shortly though, I did find this in the MyCode forum which might help you http://community.mybboard.net/thread-50655.html
Yeah, I have made up that RegExp by myself, and after seeing the link you've given, I've found that mine was incomplete. It's alright now.

Thank you for your time!