I did the following: I wrote my question, paste my code, then click {} from the format toolbar. My code turns to grey-colored, but is not colored as I saw in some other posts (keywords are colored) also I can't insert spaces once I use {}. how can I format my code in my posts ?

1 Answer
1

Wait a moment. When editing your question or answer, the syntax highlighting is disabled temporarily. If you stop editing, after a timeout the highlighting will kick in and the colours will appear. The delay is around 5 seconds, I believe.

This does depend on the tags present on the question, or you can add hints in the markdown source of your post.

To add hints, simply add a <!-- language: ... --> comment on a line of it's own (not indented) before the code block. If you use language-all instead, the choice is applied to all code blocks in your post. See the site help text on this feature.