# MathJax Color fights Hidden Text and Wins!

It appears that using MathJax color in a hidden text block "pokes through" the hidden environment. I don't believe this is desired behavior, so I'm reporting as a bug.

very hidden. $\color{red}{\text{Not so hidden...}}$ Hidden again.

• Disclaimer: I know nothing about this! While certainly a surprise, this may be A) not so easy to fix, if the working of the spoiler field relies on turning black text to grey and back, B) a feature as opposed to a bug or, if you prefer, by-design :-) – Jyrki Lahtonen Dec 29 '14 at 17:06
• I thought it wouldn't be easy to fix, but I still felt that reporting the behavior would be better than leaving it undocumented. – apnorton Dec 29 '14 at 17:13
• I think this is a legitimate bug, though likely in the "won't fix" territory. The spoilers indeed work by making the color of text identical to background, and MathJax, running later on the page, overrules that. – user147263 Dec 29 '14 at 17:16
• Interestingly enough, the behavior does not exist on the Android app. – apnorton Dec 29 '14 at 17:16
• This might just be me being naïf with my limited skills, but wouldn't simply applying something like hidden instead of changing the color solve this? I imagine there are other technical problems with that though. – Najib Idrissi Dec 29 '14 at 17:30
• This behaviour also does not exist on mobile site (click "mobile" in the footer). Both the mobile site and the app implement spoilers differently, by replacing the text with "[Click to show] spoiler", and then inserting the text if clicked. – user147263 Dec 29 '14 at 17:31
• @NajibIdrissi Shog says it's because of reasons, some of the reasons being copy-paste and ability to display the text by selecting it. – user147263 Dec 29 '14 at 17:38
• @Behaviour I don't really understand the argument, since you can click on the spoiler block to make it visible. How about opacity otherwise? – Najib Idrissi Dec 29 '14 at 17:43
• @NajibIdrissi I never knew about click-to-keep-visible. Thanks! The post I linked is from 2011, so it's quite possible that by now whatever reasons made them use the color attribute for spoilers no longer apply. – user147263 Dec 29 '14 at 17:44
• SOUP fixes this, as a side effect of this general spoiler CSS fix. (It seems to break the click-to-keep-visible functionality, though. I'll fix that ASAP; thanks for pointing it out!) – Ilmari Karonen Dec 29 '14 at 21:20
• ...and the click functionality is fixed too, as of SOUP v1.26.3. – Ilmari Karonen Dec 29 '14 at 21:46

## 1 Answer

I don't know why you're using colored text in spoiler blocks, but the obvious solution here is to just not use colored text in spoiler blocks.

Spoilers are fairly reader-hostile by-design, so if something about them strikes you as odd perhaps you could just skip using them entirely.

• ...or just think about the color-blinded readers, and don't use colored text at all. – Asaf Karagila Dec 29 '14 at 19:46
• That's even better. – Shog9 Dec 29 '14 at 19:47
• @AsafKaragila It's possible to use colored text in ways that even color-blind readers can distinguish. Colored text is frequently useful. – Emily Dec 29 '14 at 19:53
• @Arkamis: I know. I've opened a meta thread about this issue some long time ago, you can probably find it and see for yourself. (I'm not saying that colors should never be used, but more often than not, their use can be replaced by something monochromatic.) – Asaf Karagila Dec 29 '14 at 20:01
• This is as much of an answer as a doctor saying "oh, it hurts when you jump on one foot? Don't do that--no one needs to jump on one foot anyway." :P However, as a programmer, I understand that this issue is so minor that it's most likely not worth fixing. – apnorton Dec 29 '14 at 20:38
• Yes, it is exactly like that, @anorton. "Doctor, holding my hand in front of my face hurts when I suddenly draw my hand inwards!" What do you want me to say, "oh, let's engineer a hole in your face?" Obviously, if you have a good reason for putting colored text in spoilers (and for using spoilers at all on a math site) then you should elaborate on that in your bug report - as it is, I consider this a feature implemented for the benefit of folks on sites for speculative fiction, and sort of a misfeature everywhere else. – Shog9 Dec 29 '14 at 20:49
• @Shog9 well played, well played. :) – apnorton Dec 29 '14 at 20:50
• @Shog: There are excellent reasons for using spoiler tags on a math site, actually. You give a hint, or a partial solution, and add a spoiler with the final answer, or a more elaborate hint. But I do like that attitude about engineering a hole in someone's face just so they can push their hand through! – Asaf Karagila Dec 30 '14 at 4:01