Skip to main content

All Questions

3 votes
2 answers
190 views

Why does this code block have weird formatting?

COMMAND and OUTPUT is formatted as italics in this post. I know <pre><code> can be used to format text in code blocks, but that answer uses just a normal code fence ``` ```. Here's the ...
phuclv's user avatar
  • 42.4k
6 votes
0 answers
193 views

Syntax highlighting Java code in response to a Kotlin question

I provided an answer to a question tagged kotlin and javafx. The code blocks in my answer were predominantly in Java. Without any language tags on the code blocks, the syntax highlighting for the Java ...
James_D's user avatar
  • 210k
3 votes
0 answers
92 views

Is there a comprehensive list of languages the code highlighter supports? [duplicate]

The triple backtick is my go to, to format snippets of code. ``` I regularly use them like: ```json for JSON ```py for Python ... and many more Does a list of the linters Stack Overflow supports ...
Paulo's user avatar
  • 10.9k
2 votes
1 answer
76 views

Code snippet not getting highlighted [duplicate]

I have a piece of code after a list in a question. It is not getting syntax highlighted, even if I use SO code block, or indent it myself. If I move it before the list, it works as expected. Also, ...
software_writer's user avatar
2 votes
0 answers
67 views

Escape backslash in code block [duplicate]

I just created this answer and am having a hard time escaping the backslash in order to keep the syntax highlighting consistent. Normally I would just use double backslash, however in this instance ...
Felix Eve's user avatar
  • 3,863
3 votes
0 answers
293 views

Is it possible to get more advanced Ecmascript syntax highlighting for code snippets?

I've done some searches and this doesn't appear to be an option as far as I can tell. I know about <!-- language: lang-js --> and it works great, but it doesn't do a great job with some more ...
jaybee's user avatar
  • 2,300
11 votes
1 answer
180 views

Syntax Errors in Code Renderer?

In this question about a syntactic impossibility in Java, I had to write a chunk of code that purposely contained a syntax error. After submitting the question, I was reasonably surprised because the ...
Clashsoft's user avatar
  • 11.9k
8 votes
2 answers
822 views

Can I force syntax highlighting for a certain language? [duplicate]

I notice that stackoverflow automatically adds syntax highlighting to code blocks. I hate this. It always applies the wrong language's highlighting to the wrong code. Example? The last question I've ...
Marco Prins's user avatar
  • 7,419