Linked Questions
193 questions linked to/from What is syntax highlighting and how does it work?
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 ...
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 ....
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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?...
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 ...
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 ...
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 ...
-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())...
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">&...
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?
...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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
,...
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 ...
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
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.
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....
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?
......
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-...
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 ...
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;
}
....
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 ...
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?...
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 ...
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="...
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.
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 ...
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.
...
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 ...
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 ...