Linked Questions

629 votes
1 answer
133k views

What is syntax highlighting and how does it work?

I noticed that sometimes my code gets highlighted in different colors when rendered. What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a ...
1 vote
1 answer
153 views

Problem with Code Formatting [duplicate]

Possible Duplicate: Manually specify language for syntax highlighting For some reason when I edit this question, and I select the relevant code portions, and hit the code formatting button, my ...
Adam Rackis's user avatar
  • 22.3k
377 votes
11 answers
58k views

Syntax highlighting language hints [duplicate]

Do you think it would be worthwhile to provide hints as to what language to use for the syntax highlighting? Sometimes I find the highlighting on SQL or VB.NET answers is more distracting than ...
Rowland Shaw's user avatar
  • 7,333
57 votes
23 answers
38k views

Changes to syntax highlighting

locked for the history - please post bugs and feature-requests separately. -Shog9 We're changing the way syntax highlighting is done on the Stack Exchange engine. As you probably know, we use ...
Jeff Atwood's user avatar
156 votes
1 answer
32k views

Interface options for specifying language prettify [duplicate]

I'm the maintainer for Google Code Prettify. Markup authors can specify the language for source code, but not markdown authors. Are the SO admins interested in a way of doing this? If so, might the ...
Mike Samuel's user avatar
  • 2,026
17 votes
2 answers
16k views

Stack Overflow syntax highlighting [duplicate]

When using SO's code blocks, can you control how syntax highlighting is performed? Many times, I've pasted (for example) some shell output into an SO answer, and the syntax highlighting has been ...
Rodrigo Queiro's user avatar
6 votes
4 answers
358 views

<pre> versus four-space indentation?

I frequently make answers with code samples that are surrounded with pre tags instead of having each line indented with an extra four spaces, because doing the latter either means I have to add four ...
Delan Azabani's user avatar
4 votes
1 answer
7k views

How to insert code in stack overflow [duplicate]

Possible Duplicate: How do I format my code blocks? 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 ...
Jury A's user avatar
  • 151
2 votes
2 answers
2k views

Mark two languages in one code block

I have this question. I reformatted it, to get better view and syntax-highlighting. Referring to this and this, there is special markdown to force special highlighting. But that has one requirement: &...
Shegit Brahm's user avatar
7 votes
2 answers
543 views

Please add a "prettyprint" class when explicitly defined class with <!-- language: something -->

Please add a "prettyprint" CSS class when explicitly defining class with <!-- language: something --> regardless of there being no valid language tag. It is inspired by question Syntax ...
YOU's user avatar
  • 25.3k
4 votes
1 answer
1k views

List of languages for syntax highlight [duplicate]

When putting some code sections into SO questions, the system tries to detect the language and automagically colorizes the code but sometimes if the excerpt of code is small enough it cannot get the ...
Seki's user avatar
  • 496
5 votes
1 answer
419 views

Why do I get nice Erlang syntax coloring in preview but not in the rendered page after I post?

While I edit Erlang code there is nice syntax coloring shown in the preview. Once I post, the rendered code is often only black on grey. Example: Erlang pattern matching bitstrings Counterexample: ...
Peer Stritzinger's user avatar
31 votes
1 answer
253 views

Please provide a language pick-list for syntax highlighting

I saw on another question that mods have access to a nice pick-list for languages in certain scenarios (this one was about setting the default language for tags): I'd love to be able to use such a ...
Aaron Bertrand's user avatar
  • 43.5k
4 votes
1 answer
283 views

Can WPF tag highlight C# code?

Very often when questions are tagged as WPF, I find myself putting little snippets of C# into the answer (even if the question itself is specified in purely xaml, occasionally some C# makes a better ...
KDiTraglia's user avatar
5 votes
2 answers
388 views

Why is the syntax highlighting for this question's code all red?

I was reading this question, and the code is displaying all in red (the colour normally reserved for strings). I could perhaps understand no syntax highlighting (though the question is tagged Python),...
Cameron's user avatar
  • 509
21 votes
1 answer
213 views

Please update the editing help

I only recently learned about a new feature to insert those fancy tags into your post. I didn't know what the exact syntax was. It was only now that I needed it myself, and I've been searching like a ...
fretje's user avatar
  • 19.2k
2 votes
1 answer
324 views

Formatting preview is not accurate for code blocks in numbered lists [duplicate]

Possible Duplicate: Can the </pre> tag start in a new line (possible previewer bug)? Edit this post and look at the preview. Note how the preview incorrectly shows that the following ...
Phrogz's user avatar
  • 2,726
8 votes
1 answer
161 views

Adding syntax highlighting item in the editing toolbar

I have a simple feature request. Can we have a new item in the editing toolbar referencing syntax-highlighting? It will display all available languages and simply add the right line at the cursor ...
Jean-Rémy Revy's user avatar
-6 votes
1 answer
191 views

The Javascript Syntax Highlighter Upsets Me

Give me the liberty to disable this problematic syntax highlighting script, please. It does more harm for me than good.
user130648's user avatar
2 votes
2 answers
129 views

Why isn't syntax highlighting working on this answer?

My answer here is on a question that is tagged javascript html5 canvas animation. When I am editing the question I occasionally see syntax highlighting applied to the code block. However, when I view ...
Phrogz's user avatar
  • 2,726
0 votes
1 answer
98 views

How does the code highlighting feature work? [duplicate]

Possible Duplicate: Changes to syntax highlighting Over at ServerFault we are having a community discussion about wether or not we should enable code highlighting. However we can't seem to find ...
Bart De Vos's user avatar
3 votes
0 answers
117 views

Why do unknown language IDs in "prettification" fall back to guessing instead of no prettification?

The feature for being able to override language prettification is good. But if a language is unknown, it seems to "just guess". Note the lower code sample when I specify lang-rebol: https://...
HostileFork says dont trust SE's user avatar
4 votes
1 answer
46 views

Include information on manual syntax highlighting in formatting help page

The formatting help page should include the information on the magic comment and language codes needed trigger correct syntax highlighting, prefaced by a brief summary of when the magic comment might ...
Phrogz's user avatar
  • 2,726
2 votes
0 answers
44 views

Syntax highlighting razor views [duplicate]

I answered the following question yesterday ckeditor and razor syntax templates I've noticed that the syntax highlighting of the razor code is somewhat broken. Is there anything that can be done ...
user avatar