XF 2.0 Custom Bbcode tag

_PkZ_

Active member
So i have made a custom bbcode tag for
...
PHP:
public static function table($tagChildren, $tagOption, $tag, array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer)
{
    $res = $renderer->renderSubTree($tagChildren, $options);
    return "<table>{$res}</table>";
}

$res is returned ok but after each tr-tag there is appended a br-tag.
Each </tr> becomes </tr><br />

My function for TR returns '<tr>{$trcontent}</tr>' and nothing else.

I have searched the code but cant figure out where that <br /> tag actually are generated. Anybody have any idea where i should start searching?

EDIT: Looks like there is appended a br-tag if [tr]...[/tr] have a line-feed after. Is it the editor that replaces "\n" with <br /> ?
 
Last edited:
In the custom BB codes section of the adminCP edit your bbcode tag. There should be an advanced option for "Trim line breaks after". Set it to 1.

This is a rather simplistic bbcode btw. You would be better off doing it completely in the adminCP, instead of running a function for it.
 
In the custom BB codes section of the adminCP edit your bbcode tag. There should be an advanced option for "Trim line breaks after". Set it to 1.

This is a rather simplistic bbcode btw. You would be better off doing it completely in the adminCP, instead of running a function for it.
There are some more handling of params etc. So i had to do it in code. But the result are the same with this simple version.
Thank you for the tips of the advanced options.
 
Top Bottom