Sometimes there are questions which could benefit from additional information in an unobstrusive way. Example:
A question about a bug in an MCVE with sample data to use. It might be nice to allow hiding the example data for better overview, especially with long sample data.
Spoilers are a bad way to go about this. Mainly because they use the same screen real-estate as the content they hide:
Spoiler blocks
are just as long
as their content
without any good reason!
There's also another way of hiding text: Stack-Snippets. But snippets currently don't allow this in an arbitrary manner. The only allowed languages for snippets are: html, css, js. This is sligtly unfriendly, especially when it's not possible to open a snippet without declaring one of these languages at the top:
<!-- begin snippet: (html|css|js) hide: (true|false) --> It might be worth allowing to specify arbitrary languages or at least none, which will be displayed in the snippet block.
Most spoiler blocks I see on other sites are just:
var showspoiler = function() { $(".spoiler").removeClass("spoiler"); } .spoiler { display: none; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="button" id="showspoiler" onclick="showspoiler()" value="[Spoiler]" /> <div class="spoiler">Some spoiler text <br/>with multiple lines <br/>that don't show up <br/>before the spoiler is expanded</div> well they are significantly shorter than the spoiler syntax used here.
This would allow users to better manage the screen real-estate of their questions / answers. This would allow hiding of "boring and maybe not required details"