XF 2.3 bbCodes and line breaks

Robert9

Well-known member
I have asked this before, but it seems almost nobody is concerned about custom bbCodes or users who need extra effort to create visually appealing posts. When using custom bbCodes, if you select a text and apply the bbCode with a button, it’s not possible to achieve the same result as with the bold button, which does not introduce a line break.

I believe this change in behavior occurred with versions 2.1 or 2.2, likely due to the integration of third-party editors in XenForo.

The only solution I’ve found so far is to use regex to process the text while saving, removing the line breaks with str_replace or preg_replace.

Is there no other way to address this issue? The standard b (bold) bbCode doesn’t have this problem, but I haven’t been able to determine why. Does anyone have a practical idea on how to make custom bbCodes work without introducing unwanted line breaks?
 
I'm seeing the same issue. I have a highlighter custom bbcode which is just a simple replacement html <span style="background-color:#FFFF00;color:#000000;">{text}</span> no matter what I do if I add a button for it on the editor this is what happens for me and my users:

This is what happens when
[HILITE]applying the Highlighter[/HILITE]
custom bbcode via the button in the editor

It inserts a line break before the code and one after.

Am I doing something wrong?
 
Back
Top Bottom