80
votes
Please update the Google Prettify syntax-highlighting library
Stack Overflow should start its own fork of code-prettify, or move to a different solution.
Most pull requests don't get reviewed or merged in the Google repository anymore.
There are more missing C# ...
74
votes
Accepted
Should we approve suggested edits that change ``` to four spaces code formatting or vice versa?
No. Edits like those should be rejected for not making a meaningful improvement or making the post easier to read.
Edits that only change formatting are appropriate in very narrow circumstances, such ...
56
votes
Accepted
Is serially editing posts to include syntax highlighting helpful?
I'm strongly in favour of edits like this. Syntax highlighting, tab-size consistency and wrapping to avoid horizontal scrolling can make a significant difference to the legibility of a code sample — ...
53
votes
How does the highlight.js change affect Stack Overflow specifically?
My recommendation: If you know the language, go ahead and explicitly set it.
Even on posts where the question includes exactly one language tag? So far, language tags overrode the heuristic for ...
29
votes
Should we approve suggested edits that change ``` to four spaces code formatting or vice versa?
No. These types of edits should be rejected, especially now that this type of formatting actually results in proper code formatting, and not half-broken formatting.
These types of edits make ...

ZoeMod
- 27.1k
25
votes
C++ tag variants do not highlight syntax
Braiam is right: the solution here is to tag all questions with the c++ tag, and then you'll automatically get syntax highlighting appropriate for the C++ tag.
This is just another special case of ...
24
votes
Accepted
Why isn't there support for Visual Basic syntax?
There is support for VB syntax highlighting:
Dim text As String = "Hello, World" 'The text variable holds Hello, World
Questions where the only language tag is vb.net or vba should highlight ...
24
votes
Accepted
What should we expect from syntax highlighting auto-detection?
There are 2 main parts to this:
When highlight.js is used to detect a language, if it is given no constraints on languages to choose from, it will choose the language that results in the most ...
23
votes
Accepted
Revert new syntax highlighting
Based on this overwhelming feedback, I reverted the colors from the other day, though I did slightly brighten the previous "maroon" color that was being used just to help differentiate from black. The ...
22
votes
Accepted
'get' in a code tag does not render properly as a keyword
That is a bug in the Prettify highlighter, and unfortunately bugs should be reported on their GitHub project, as explained in What is Syntax highlighting and how does it work?. I went ahead and made ...
22
votes
Shell: make prompt # and $ uncopiable
Honestly, this is a terrible idea all-around. The devs would have to deal with questions like:
How would you tell that it's bash? In many languages, $ is usable in variable names and # means a ...
20
votes
Add syntax highlighting language for diff
Since Stack Overflow has migrated to highlight.js and there is a diff highlighter (search for "diff" on the website) available for that tool, I wonder why it is still unsupported on SO. It ...
20
votes
Accepted
How to compose yellow background blockquote?
This is a standard blockquote.
The Markdown syntax is to precede the text with a >. You can achieve the same effect in the editor by highlighting the block of text and clicking the quotation-mark ...
20
votes
Accepted
Is the following HTML comment necessary?
This edit added syntax highlighting to the code blocks. (This makes different parts of the code change color based on its function: upper case words are one color, numbers another, and keywords a ...
20
votes
Accepted
Syntax highlight apparently broken in edit preview and suggested edits queue
We managed to tackle the issue and disable the temporary fix we put in some time ago. The problem boils down to conflicts between the diff highlighting and the syntax highlighting - because of those ...
20
votes
How does the highlight.js change affect Stack Overflow specifically?
This has already been asked on MSE1 but I think it belongs here, given how important this is for SO:
What will the update cycle be?
I’m asking because the current status of highlight.js language ...
20
votes
Accepted
The revision history does not show the latest content correctly
A hotfix is now in place for this bug on both the /posts/{id}/revisions and /review/suggested-edits/{id} pages. Revisions will now be highlighted correctly in code blocks:
This is a problem with ...
19
votes
Accepted
What is the default language for the syntax highlighter?
Note: Since Stack Overflow's migration to Highlight.JS, the default is based on Highlight's automatic language discovery and best-effort highlighting.
This answer is no longer applicable, but left ...
18
votes
Accepted
Do I remove syntax highlighting for sample input/output?
For data, input text, output text, and errors, use code formatting with no syntax highlighting. Syntax highlighting is only intended for use on the specific code language which it's highlighting. If ...

MakyenMod
- 31.9k
18
votes
SO renderer breaks Makefile syntax
There's a workaround, as per mbomb007's answer to the Meta Stack Exchange feature request. Writing this:
<pre><code>Hello!
This is a tab:	:bat a si sihT</code></pre>
...
17
votes
Accepted
Syntax Errors in Code Renderer?
The syntax highlighter didn't pick up that you wanted Java highlighting. Instead, it seems to be interpreted as HTML (probably because it begins with a <). HTML attributes are set to be colored red,...
17
votes
Accepted
Trailing backslash in strings breaks code formatting
The PowerShell tag is using lang-bsh as its prettifier.
There is an open issue over on GitHub with an initial commit for a PowerShell prettifier. I linked to that item in an answer I wrote over on ...
15
votes
Revert new syntax highlighting
In order to be constructive, I'll try to provide a couple of (subjective) propositions:
The color of types, properties and methods (#0096e2) is now very close indeed to the color of unvisited ...
15
votes
Accepted
Code block containing asterisks displaying in italics
This is the syntax highlighter trying to guess at a language for the regex. highlight.js has 3 language definitions that use an emphasis class, rendered as italic text.
Since there is very little text ...
15
votes
Syntax highlighter gives up mid-word
I can repro here on Safari 14.0.2 and in STP 14.1 (BigSur).
The colors stop where the overflown area starts, this is definitively a Safari bug, you should report it to them. Unfortunately I wasn't ...
14
votes
MATLAB syntax highlighting?
MATLAB syntax highlighting is now live!
Add syntax highlighting for the MATLAB language
This is the "lite" version of @Amro's prettify script which does not include complete keyword highlighting (...
14
votes
Need automatic syntax highlighting for Pascal
OK, I've enabled this. It should be effective immediately.
14
votes
Accepted
GCC tag affects C++ syntax highlighting
I don't think that is a bug. From What is syntax highlighting and how does it work?
If there's more than one tag that has syntax highlighting, it uses a default and lets Prettify infer what's the ...
14
votes
Please update the Google Prettify syntax-highlighting library
Whatever update or replacement is chosen, please make sure it deals well with dark corners of the supported languages, because we do get questions about those! Examples that the existing highlighter ...
Community wiki
14
votes
Accepted
Syntax highlighting for JavaScript does not support template literals on Stack Overflow, but does on Meta
Stack Overflow and Meta Stack Overflow are currently running different syntax highlighters:
MSO (and MSE) are running highlight.js as of 10th September
SO (and the rest of the network) are running ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
syntax-highlighting × 345feature-request × 162
bug × 97
status-completed × 82
support × 78
tags × 61
discussion × 47
code-formatting × 26
markdown × 11
design × 8
status-declined × 7
status-bydesign × 7
edits × 6
code × 5
suggested-edits × 4
stack-snippets × 4
editor × 4
editing-help × 4
markdown-rendering × 4
meta × 3
tag-wiki × 3
formatting × 3
status-deferred × 3
powershell × 3
specific-question × 2