Linked Questions

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
143 votes
3 answers
20k views

Manually specify language for syntax highlighting [duplicate]

This is a follow-up to a question I answered earlier (Changes to syntax highlighting). For most questions that have more than one language-related tag and those with fuzzy languages (for instance ....
Alex Essilfie's user avatar
54 votes
1 answer
19k views

How can I specify a language in a code block? [duplicate]

Possible Duplicate: Interface options for specifying language prettify I don't know how Markdown recognizes which language to use in code blocks. Sometimes it doesn't guess right. Can I specify a ...
Lenik's user avatar
  • 675
29 votes
1 answer
26k views

Where is the list of language names supported by the markdown fenced code blocks? [duplicate]

Related to Implement ```-style (fenced) Markdown code blocks On this answer I used ```makefile and it is "working" the highlighting: However, on this other answer, I am also using ```makefile and it ...
user's user avatar
  • 606
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
21 votes
3 answers
893 views

VB.NET/VBScript syntax highlighting does not properly support comments [duplicate]

(Descriptions are inside the code samples) Take a look at this code Public Sub Show() System.Console.WriteLine("Hello") ' Comment here will fail subsequencing syntax highlighting System....
Sake's user avatar
  • 311
16 votes
1 answer
3k views

How to handle regex syntax highlighting [duplicate]

Many questions about regex include code blocks with language agnostic, POSIX compatible patterns, using default prettifying. (Example) This looks kind of ugly and is confusing, since some parts are ...
kapex's user avatar
  • 1,951
2 votes
3 answers
2k views

How can I prevent syntax higlighting in markdown? [duplicate]

When I wished to show example data, I used the code block syntax (4 spaces indentation after an empty line), but the data was rendered like a programming language. Can I prevent the syntax ...
Wolf's user avatar
  • 746
11 votes
1 answer
2k views

Java syntax highlighting not shown [duplicate]

This question does not show any syntax highlighting although the code seems ok to me. What is the cause of it? Tested with FF 3.6.15 and IE 8.0.
Matthias's user avatar
  • 325
8 votes
2 answers
529 views

Why is there no syntax highlight for SQL merge statements? [duplicate]

It seems, that Stack Overflow doesn't recognise the SQL:2003/SQL:2008 MERGE statement, as can be seen in my answer here: Oracle: Updating a table column using ROWNUM in conjunction with ORDER BY ...
Lukas Eder's user avatar
  • 3,371
12 votes
1 answer
450 views

Elixir Syntax Highlighting [duplicate]

Can we please have syntax highlighting for Elixir? I've had a look at the editor advanced help and Google's library documentation to find that it's not yet supported. Nonetheless I thought I'd ask ...
Diego Barros's user avatar
5 votes
2 answers
227 views

Syntax Highlighting Doesn't Recognize Line Continuations Within VB6 Comments [duplicate]

I've run into some unexpected syntax highlighting mistakes while I was asking a question about VB6. When I use _ after using ' to add comments about my code I see that _ does not work within ', but ...
Berker Yüceer's user avatar
3 votes
2 answers
236 views

Syntax highlighting is inconsistent [duplicate]

In this question, why is ElementByElement highlighted as a method, but ElementByElement2 isn't? EDIT: To submit a new issue to Prettify, I'd like to know what version Stack Overflow uses. 21-May-2009?...
Alexey Romanov's user avatar
4 votes
1 answer
1k views

Syntax highlighting and non-ASCII characters [duplicate]

I think Markdown google-code-prettify has some incorrect lexical rules for Java (and possibly other languages). It correctly identifies this code block from SO question 1485832 as being written in ...
user avatar
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
2 votes
1 answer
769 views

SQL syntax highlighting bug in StackOverflow [duplicate]

StackOverflow engine treats backslash character \ as an escape symbol for string literals. But backslash is NOT an escape symbol in SQL. So, simple statement select '\' from dual produces incorrect ...
Egor Skriptunoff's user avatar
-2 votes
1 answer
219 views

Syntax Highlighter for Java [duplicate]

It seems the syntax highlighter is not able to handle Java. Any idea how to help fix this? A sample code is below, and link1 and links2 in stackoverflow. try (Statement stmt = con.createStatement())...
Ahmed Ashour's user avatar
1 vote
1 answer
988 views

XML Syntaxhighlight highlights elements in CDATA [duplicate]

If you manually declare code to be XML, code within CDATA is still highlighted, even though it should be treated as text. Example: <element test="test"> <![CDATA[<font size="2">&...
Kevin Ji's user avatar
  • 1,323
13 votes
1 answer
274 views

Syntax highlighting for C doesn't properly recognize `restrict` as a keyword [duplicate]

And while we're at it, C11 adds some keywords like _Atomic as well. Is this the right way to submit requests for addition, or would it be better to ask for it in the 'Google Code Prettify' project? ...
Johan Bezem's user avatar
3 votes
2 answers
157 views

CMD `::` autoformats badly [duplicate]

From How to run a PowerShell script within a Windows batch file There's an idiom in CMD scripts to use :: as a comment delimiter. (: means a label, so :: gets ignored.) I use it because I think it's ...
Jay Bazuzi's user avatar
14 votes
1 answer
406 views

Please add support for PowerShell syntax highlighting [duplicate]

StackOverflow currently does not support syntax highlighting for PowerShell. Please add support for this in a future revision.
Trevor Sullivan's user avatar
3 votes
1 answer
146 views

Code containing HEREDOC is not highlighted correctly [duplicate]

Not sure if this was brought before but I noticed on several occasions that code containing HEREDOC syntax will not be correctly highlighted. Example at PHP domdocument if statement for when img tag ...
Gordon's user avatar
  • 7,074
10 votes
1 answer
179 views

Fix for $# code color highlight [duplicate]

I am a Perl coder and I would like to ask Stack Overflow to fix code color highlights for # comments. It works properly for real comments, such as # this is a comment but when $# is in code, such ...
user avatar
9 votes
1 answer
116 views

How to add syntax highlighting for new language [duplicate]

Is there already a standard way for introducing syntax highlighting for a language (and tag) that did not previously have it? I would like to have syntax highlighting for the isabelle tag, since code ...
chris's user avatar
  • 221
2 votes
2 answers
224 views

Syntax highlighting for MySQL not working [duplicate]

See: https://stackoverflow.com/posts/7300401/revisions It doesn't do highlighting when I specify <!-- language: lang-mysql --> (or if the question is tagged mysql), but it will work fine if I ...
NullUserException  อ_อ's user avatar
10 votes
1 answer
427 views

No syntax highlight for Fortran? [duplicate]

I was checking out this question on SO, and noticed that there is no syntax highlighting for the code snippet. I realise that Fortran is a pretty obscure language, especially on SO, so I don't really ...
Some programmer dude's user avatar
6 votes
3 answers
181 views

Would it be possible for the syntax highlighter to allow for SQL capitalization? [duplicate]

I've noticed that the syntax highlighter for code samples does not work with capitalization for SQL. I just posted a question on SO and had to spend a couple extra seconds to modify it to get the ...
RSolberg's user avatar
  • 16.2k
0 votes
3 answers
228 views

WMD/Prettify does not support dot character for XML elements [closed]

The WMD (or possibly Prettify) does not support the dot (.) character for elements, despite it being part of the XML Specification. This comes up on StackOverflow with XAML related questions. Below ...
Richard Szalay's user avatar
1 vote
1 answer
221 views

Keyword 'let' from LINQ syntax is not supported by syntax highlighting [duplicate]

I found that neither on SO. nor here, on meta, LINQ syntax keyword let isn't being highlighted: from f in db.Foo let b = f.Bar where b.Count == 1 select new FooBar(b); Please add.
abatishchev's user avatar
  • 3,013
4 votes
2 answers
169 views

First letters of XML attributes not colored correctly if capitalized [duplicate]

If the first character(s) of an XML attribute are capitalized, they don't get colored in the usual attribute way: <element InitialCap="1" initialLower="2" ALLCAPS="3" SOMEcaps="4" /> It would ...
Chris Farmer's user avatar
4 votes
1 answer
206 views

Syntax highlighter bugs on multiple <script> tags [duplicate]

To illustrate, multiple non-script tags works fine: <element name="value"></element> <element name="value"></element> But multiple script tags bugs the highlighter, see the ...
user avatar
4 votes
3 answers
150 views

Shouldn't the code formatter highlight the word "having" for SQL syntax? [duplicate]

In this SQL statement, notice the color of the word "having" versus the words "select", "from", "where", and "group by" select cu.name ,cu.email ,count(*) as books_purchased from customers cu ,...
JosephStyons's user avatar
0 votes
1 answer
188 views

Syntax highlighting thrown off by apostrophe in comment [duplicate]

I noticed a bug in the syntax highlighting for Objective-C code. See this post: https://stackoverflow.com/questions/25623716/error-no-such-table-sqlite The apostrophe in a comment in the second code ...
Zev Eisenberg's user avatar
2 votes
2 answers
66 views

Did I do my syntax highlighting wrong? If so, what is the right way? [duplicate]

I tried setting a syntax type based on Jeff's Hints, but it doesn't seem to be working properly. Did I do it wrong? https://stackoverflow.com/a/8546141/124069
Chase Florell's user avatar
4 votes
1 answer
168 views

JavaScript regex syntax highlighting issue [duplicate]

if(!/^https?:\/\//.test(val) && foo == 'bar') { val = 'http://' + val; } As you can see, the // causes the highlighter to switch to comment mode which is incorrect.
ThiefMaster's user avatar
  • 15.6k
3 votes
1 answer
198 views

Syntax highlighting for C++ code, initializing with `()` vs `=` [duplicate]

I had initially asked this on Code review meta but @Mast in the comments suggested me to ask this on the main meta site. I have tested it on Stack overflow, Code review, and Software Engineering sites....
user avatar
3 votes
2 answers
144 views

Syntax highlighting broken [duplicate]

Syntax highlighting seems to have been broken recently. For example see the code example at: WPF TextBlock Padding is cutting off text All the attributes' first letters are black. Is this a bug? ......
sourcenouveau's user avatar
3 votes
2 answers
161 views

Syntax Highlighting - Two Character Identifiers [duplicate]

I noticed a bug/feature with the syntax highlighting where two-character capitalized identifiers are not being highlighted inside code blocks. This does not appear to be a problem in the case of two-...
Nathan Taylor's user avatar
3 votes
1 answer
128 views

My syntax highlighting stopped working on Stack Overflow [duplicate]

All of a sudden, my syntax highlighting stopped working on Stack Overflow which can be seen in this answer. And now, even if I edit that post, try to post a question or an answer, there's no syntax ...
Meleak's user avatar
  • 183
5 votes
1 answer
183 views

Syntax-Highlighting won't recognize all CSS keywords [closed]

I just discovered a strange behavior of the CSS syntax highlighting feature which you can see in the following code example: .first_rule { color: red; } .second_rule:hover { color: blue; } ....
YMMD's user avatar
  • 161
2 votes
1 answer
142 views

String not displaying correctly [duplicate]

I just answered my own question here (GeoPheonix answered in the comments but didn't provide a full answer), and the string in the code isn't displaying correctly: This may seem like a minor nitpick ...
SomeKittens's user avatar
  • 2,326
1 vote
2 answers
162 views

Syntax highlighting fails to highlight "abstract" correctly [duplicate]

I've just noticed that the syntax highlighting no longer highlights C# "abstract" keyword correctly: Is this an abuse of the type system? I think it used to work correctly before. Anything changed?...
mmx's user avatar
  • 17.2k
4 votes
2 answers
124 views

Incorrect C# syntax highlighting with @"\" [duplicate]

The title really says it all, but when I use the @ character to ignore escapes in a string literal @"Like This\", the \" is interpreted as a quote character belonging to the string rather than the ...
Eric J.'s user avatar
  • 1,425
11 votes
0 answers
189 views

Style XML element in code block messes up syntax highlighting coloring [duplicate]

If you put some XML in a code block (by indenting by 4 spaces) and one of the tags is <Style> it will mess up the syntax highlighting of the generated result. This works: <Style2 Foo="...
Isak Savo's user avatar
  • 211
5 votes
2 answers
87 views

Incorrect syntax highlighting with non-ASCII characters [duplicate]

The C# highlighter (and possibly others) chokes on non-ASCII characters in class names, as can be seen in this post: Trouble with if circulating EDIT: Prettify bug report submitted.
nneonneo's user avatar
  • 3,721
0 votes
2 answers
291 views

Code highlighting with E4X XML literals in ActionScript code blocks [closed]

When entering XML literals using E4X syntax in ActionScript the code highlighting can be broken: package { public class XMLTest { public function XMLTest() { // here highlighting ...
James Fassett's user avatar
5 votes
1 answer
135 views

Bash count Syntax Highlighting problem [duplicate]

for example: Is there a bash command that can tell the size of a shell variable has a few responses which involve the bash ${#x} construct. It incorrectly treats the hash like a comment. ...
Foo Bah's user avatar
  • 1,685
11 votes
1 answer
338 views

Python's "//" operator treated as a comment [duplicate]

s = 5 // 2 if s == 2: print(s) As you can see the highlighting system treats Python's floor division operator // as the beginning of a comment. But // is not a comment in Python. Is there any ...
Maciej Ziarko's user avatar
4 votes
0 answers
198 views

Syntax highlighter misbehaves with PostScript code [duplicate]

This is probably not the most important thing, but since uservoice is closed, here's a feature request. The syntax highlighter for code blocks really screws up on PostScript code, making it ...
balpha's user avatar
  • 159k

15 30 50 per page