MyBB Community Forums

Full Version: Color formats in a dark theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The biggest visual problem with dark themes appears when a post is created which includes formatted text from a copy/paste. If a block of copy is formatted [color=black] or [color=#000000] it shows well in a light color theme, but disappears in a dark theme.

Is there a way with regex in BBcode to delete all references to [color=anything] in post content? Can it be made theme-specific?

This is my last hurdle for 2019.

Thanks.

Obviously, the ACP / Configuration / Clickable Smilies and BBCode setting allows me to not interpret color, but I'd like to make the codes disappear. There are a number of php function examples out there, but I'm not ready for a core edit for this.

I'm thinking a MyCode entry might do it. What do you think?

In addition to disabling color BBCode, I created a Drop Color MyCode regex.
regular expression is \[color=\#......\](.*?)\[/color\]
replacement is $1

So far it works. If a variant shows up that contains a name, I will work on that on a case by case basis.