MyBB Community Forums
Color formats in a dark theme - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Color formats in a dark theme (/thread-225367.html)



Color formats in a dark theme - HLFadmin - 2019-11-20

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.