XF 1.5 Can't make a custom bbcode work - help please

NavyRet

Member
Can anyone please tell me why this won't work on 1.5?

Code:
BB Code Tag: highlight
Title: Highlight
Description: Highlights selected text
HTML Replacement: <span style="background-color: {color};">{text}</span>
Example Usage: [highlight={color}]{text}[/highlight]

All other parameters are the defaults.

TIA
 
The example usage should be [highlight=yellow]Text[/highlight]

I would also suggest you use reg ex to limit the available input, to avoid the possibility of any exploits.
I use this:
1515700273761.webp
 
Thanks for the quick reply sir. In your example, would not all highlights then be in yellow? I would like it to give the user the option of choosing the highlight color. Thanks.

Edit: Using all your examples, I get the exact same this as the example after pressing post reply: [highlight=yellow]Text[/highlight]
 
Last edited:
I must be missing something because I can't seem to make it work. I've entered everything as shown and with your corrections and when I post this: [highlight=blue]some text here[/highlight] and post it, the resulting post looks the same: [highlight=blue]some text here[/highlight]. Nothing is highlighted and the bbcode is presented just as it was entered.
 
Yes, it is enabled. I guess the best way is to show you is a screen grab of what I have. When I try to use it by typing the exact example text. it doesn't parse. It just shows in the post exactly as the example text.
 

Attachments

  • XF1.webp
    XF1.webp
    65.2 KB · Views: 15
Last edited:
Nope. no joy. Output still looks like this: [highlight=yellow]sample text[/highlight]

It's 1:40 am here, so I'm off to bed. Will check back in the morning. Thanks for trying to help.
 
Last edited:
Sorry, scratch that last one. I realize now you actually were trying to set the background color. Set "Supports option parameter" to yes, because the option parameter (the part after the equals sign '=' in the opening tag) is what you're using to define the color.

85e4b2g.webp
BeJdSNX.webp
 
Back
Top Bottom