On other SE pages you can use collapsible code snippets like in this post, but it doesn't work on Magento SE.

Using this ...

<!-- begin snippet: js hide: true -->

<!-- language: lang-js -->

alert(2+ 40);

<!-- end snippet -->

Just outputs ...

alert(2+ 40);

Is there a special reason for this? I want to write a "longer" question where i would really like to use this.

1 Answer 1


As you already mentioned in your question, this question is about Code Snippet. However, code snippet is not enabled for MSE.

The feature what we have available right now is Code Blocks for which SE uses Google Code Prettify internally. So the expand/collapse-able feature would be possible only if the Code Prettify has such facility, which I don't think exist now.

Code Snippet != Code Blocks

I am not sure when and how we will get the code snippet feature here. I think this code snippet feature is only available in the site StackOverflow. So the chance to get this feature for MSE is very rare (since there exists pretty old SE sites such as SuperUser which do not have code snippet feature yet.)

Refer this answer: https://meta.stackoverflow.com/a/354002/2869218

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .