All Questions
Tagged with code-formatting syntax-highlighting
27 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 ...
5
votes
1
answer
1k
views
HTML formatting inside highlighted code blocks is no longer supported - how can I fix my posts? (Obsolete)
This question isn't relevant anymore since the site once again supports HTML formatting inside code blocks. Stack Exchange implemented the plug-in workaround noted in the answer, to resolve an issue ...
5
votes
0
answers
338
views
Is having the ability to apply rich text formatting inside code blocks important?
For many years, it's been possible to apply rich text formatting to code blocks inside posts by formatting the code block using the HTML tags <pre><code> and using more HTML tags inside ...
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 ...
8
votes
1
answer
272
views
Why does TOML code block formatting look so bad?
I have a Stack Overflow answer here that includes a TOML code block.
I have tagged the code fence:
```toml
But the resulting highlighting looks very poor and does not even highlight the comments ...
3
votes
0
answers
52
views
Partial syntax highlighting in a question [duplicate]
On questions where the code overflows, the syntax highlighting stops wherever the end of the content visible without scrolling is.
Scrolling down a bit fixes the issue. This problem occurs in Safari ...
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 ...
8
votes
3
answers
259
views
Visually distinguish code highlighting tags
Recently I'm encountering more and more questions that contain a significant amount of code but due to the poor/lazy choice of tags, the code is usually not highlighted. When the question contains ...
11
votes
2
answers
4k
views
PowerShell Syntax Highlighting
I mainly answer PHP questions where syntax highlighting has always worked for me with just indentation. I've just started using PowerShell and have asked a couple of questions and syntax highlighting ...
6
votes
0
answers
126
views
Last character inside single quotes in code block missing syntax color [closed]
I just came across this old question and in Chrome with dark mode, it looks like this:
It happens when the language of the code block is set to lang-default:
def a = "a string"
def b = '...
3
votes
0
answers
63
views
Code formatting in Scala is wrong with multiple line string [duplicate]
I am asking this question after tackling this question:
How to test akka-http route to handle exception?
There is a lot of code there, bur as you can see the formatting is not correct for the first ...
108
votes
3
answers
17k
views
How does the highlight.js change affect Stack Overflow specifically?
Update 2020-09-24
This is now live network-wide (including Stack Overflow).
Update
This is now live on Meta Stack Exchange and Meta Stack Overflow. Any bugs and feedback can be posted on the main post ...
9
votes
2
answers
384
views
Why does syntax highlighting only work when previewing an edit to this old answer?
I made an edit to this old answer of mine. Among other changes, I converted from indentation-defined code blocks to code fence-defined code blocks. Despite the question being tagged as C#, I ...
5
votes
0
answers
65
views
Syntax highlighting does not work for shell scripts written in bash [duplicate]
I tried using the <!-- language: bash --> and also an option from this question - bash doesn't format properly without language comment, but neither of lang-bsh or lang-sh work too.
A snippet ...
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, ...