Questions tagged [syntax-highlighting]

For questions about the syntax highlighting performed inside code blocks on Stack Exchange sites.

Filter by
Sorted by
Tagged with
5 votes
0 answers
77 views

Add JavaScript default language hint to [mongo-shell] tag

My mongo-shell code examples are not syntax highlighted. It seems that syntax highlight language is identified by question tags. The MongoDB shell is built on a JavaScript execution engine (V8). ...
Steve Tarver's user avatar
  • 3,170
5 votes
0 answers
92 views

possible bug with code highlight

I just finished an answer https://stackoverflow.com/a/32405036, and found the highlighting is broken. This works ok: replace(src_path,'/','') src_path, But this causes weird things, where code is ...
Juan Carlos Oropeza's user avatar
5 votes
0 answers
92 views

Syntax highlighting has a slight bug for swift function labels

From this answer: The 2nd # marks the label as required and should not be treated as a comment. Code: func addLocation(#latitude : Double, #longitude : Double) { /*...*/ } addLocation(latitude: 125....
Robert's user avatar
  • 38k
5 votes
0 answers
197 views

Add syntax highlighting for [python-3.4]

The python-3.4 tag does not on its own trigger Python-specific automatic syntax highlighting in questions and associated answers (sample question). It's generally good practice when asking about ...
MattDMo's user avatar
  • 102k
4 votes
1 answer
120 views

Syntax highlighting for JavaScript does not support template literals on Stack Overflow, but does on Meta

I just realized that syntax highlighting for javascript is different on Meta Stack Overflow compared to Stack Overflow. Meta: Stack Overflow: Ignoring the different colors, you can see that the ...
shreyasm-dev's user avatar
  • 2,796
4 votes
1 answer
115 views

Black, green, blue and light blue are pretty colorblind-unfriendly choice for code colors

Many of my colorblind friends have had trouble seeing the syntax highlighting on this website due to the choice of colors. Can anything be done about this?
YoTengoUnLCD's user avatar
4 votes
1 answer
165 views

Elixir syntax highlighting does not work [duplicate]

I notice that Elixir snippets are not highlighted. It's supported by the Highlight.js project but using 'elixir' directly after backticks does not do anything: module Foo do def test(arg) do IO....
Andrew France's user avatar
4 votes
1 answer
71 views

Is there a way to provide a syntax hint for code within a blockquote?

Hints like <!-- language: lang-perl --> work fine with top-level code blocks, but there seems to be no way to influence the rendering of code posted within blockquotes I realise that this ...
Borodin's user avatar
  • 127k
4 votes
1 answer
257 views

Strange code highlighting issue in C# code

In this post: How to identify html tags in html string The language is not being recognized, the first string inside the quotes and the comments are all off. When I try to answer, the same strange ...
anastaciu's user avatar
  • 23.6k
4 votes
1 answer
82 views

Add syntax highlight 'default' for tag [elm] (currently 'none')

For some time now I have been adding hints <!-- language: lang-elm --> to code snippets in elm language. Which gave the best result in syntax highlight but apparently was just forcing the '...
lonelyelk's user avatar
  • 588
4 votes
1 answer
143 views

Customizable syntax highlighting

I noticed that the syntax highlighting theme has been changed recently, while I don't particularly the new theme I was wondering what about having the possibility to customize the syntax highlight ...
Jack's user avatar
  • 133k
4 votes
1 answer
602 views

Swift questions are missing syntax highlighting

I saw Swift got some syntax highlighting then when you changed the tag to swift it lost it again!
Mohsen's user avatar
  • 65.1k
4 votes
0 answers
106 views

Next.js and Next.js 13 tags should select TypeScript highlighting

Related: 1, 2, 3, probably many others, some out of date (Prettify is abandonware). Is there an alias system for inferring the language which is moderator-editable? An example here of where this is a ...
Zac Anger's user avatar
  • 7,401
4 votes
0 answers
111 views

Set C++ as the default syntax highlighter for the [systemc] tag

Please set the syntax highlighting language used by the systemc tag to be the same as the c++ tag. Currently, systemc does not have syntax highlighting, but c++ does. The systemc tag info aptly ...
toolic's user avatar
  • 60.3k
4 votes
0 answers
90 views

Is there a way to fix the syntax highlighting for PHP code blocks that include HTML?

Here is an example:. It seems the highlighter cannot handle more than a pair of HTML attributes, failing the next one and ruining the rest of the code. A proper syntax highlighting is very important ...
Your Common Sense's user avatar
4 votes
0 answers
71 views

TypeScript syntax highlighting not working correctly (anymore?) [duplicate]

Martijn Pieters is right, this is answered by What is syntax highlighting and how does it work? Here's the feature request to enable TypeScript. I don't recall seeing this problem with the previous ...
T.J. Crowder's user avatar
4 votes
0 answers
63 views

Make `angular2` and `angular` (not `angularjs`) tags bind to JavaScript / ES2015 syntax highlighter

Based on Code Tag Association to Syntax Highlighting Request, could someone please make angular2 and angular (not angularjs) tags bind to the JavaScript/ES2015 and HTML syntax highlighting? I.e. ...
Ondra Žižka's user avatar
4 votes
0 answers
154 views

C# 6.0 String Interpolation Highlighting [duplicate]

Text highlighting for string interpolation is missing for C# 6 syntax StackOverflow highlighting: Visual Studio 2015 highlighting: i.e. if the string is prepended with a $ then {something } should ...
Meirion Hughes's user avatar
4 votes
0 answers
62 views

Using custom prettifying code inside a SO post

In my Stack Overflow activity, I'm mostly interested in HPC and parallel programming, notably with openmp and mpi. Both of them support c, c++ and fortran as targeted languages, so I have quite often ...
Gilles's user avatar
  • 9,374
4 votes
0 answers
93 views

Can questions tagged with [yii2] have PHP's syntax highlighting?

Many askers set the yii2 tag without the php tag. Can questions with this tag also be automatically colorized with PHP's syntax highlighting?
user avatar
4 votes
0 answers
98 views

Syntax highlighting for "Java Card" code?

Normally when we post a piece of code that is written in Java in our question, adding the Java tag to the question activates syntax highlighting which makes it easier to read. I want to know if is ...
Ebrahim Ghasemi's user avatar
4 votes
0 answers
145 views

highlighting language of xpath tag: suggest change to lang-xml

Having read What is syntax highlighting and how does it work?, I'm looking for a way to improve the syntax highlighting for XPath. Currently, the highlighting language for the XPath tag is "default". ...
LarsH's user avatar
  • 27.8k
4 votes
0 answers
121 views

Why does XSLT code sometimes not get formatted automatically?

The pretty formatting that usually happens automatically for XSLT code sometimes does not work. It appears that when a question is tagged with the general xslt tag, all is well. However, when an ...
kjhughes's user avatar
  • 109k
4 votes
1 answer
266 views

PHP Syntax highlighter is not working properly [closed]

Stack Overflow's syntax highlighter is not working properly if I add php syntax in-between HTML. I checked in other markdown editors and it is working fine. Not Working (PHP) <picture> <...
VnoitKumar's user avatar
  • 1,418
3 votes
1 answer
104 views

Is "language: lang-ada" not fully implemented, or buggy?

I saw a post on Meta about the syntax highlighting and noticed that I could add <!-- language-all: lang-ada --> to ada-tagged posts to add colored syntax highlighting. However, lang-ada wasn't ...
Keith M's user avatar
  • 863
3 votes
1 answer
75 views

VB code formatting is broken when comments are encountered?

I noticed that code formatting / colorization does not seem to be working right for questions which have VB code including comments. Here's an example from https://stackoverflow.com/a/56662842/3195477:...
StayOnTarget's user avatar
  • 12.4k
3 votes
1 answer
221 views

Syntax highlighting mixing on Stack Overflow

As adequately explained in this post, Stack Overflow does not have its own syntax highlighting engine but uses Google Code Prettify. It is however possible to override this syntax in use with a ...
Kurt Van den Branden's user avatar
3 votes
2 answers
56 views

Literals within block quotes ignore overriding syntax selection

My recent answer starts with an overriding syntax selection: <!-- language: lang-none --> however the syntax colouring within the first block quote, which is done by using > followed by ...
Borodin's user avatar
  • 127k
3 votes
1 answer
114 views

SQL syntax highlighting is not applied on PHP question

Suddenly the editor stopped highlighting the keywords in SQL. For example SELECT, FROM, INNER JOIN, etc. should be highlighted in blue, but it’s not happening. This is my query and here is my answer: ...
Pரதீப்'s user avatar
3 votes
1 answer
138 views

Syntax highlighting for Crystal

Crystal is a new programming language with Ruby inspired syntax. So until it's popular enough for a plugin for Google code prettify, I propose to associate the crystal-lang tag with lang-rb, which ...
Jonne Haß's user avatar
  • 4,827
3 votes
1 answer
78 views

Automatic tag-inferred syntax highlighting does not work in SO for LaTeX

It seems that the automatic tag-inferred syntax-highlighting doesn't work for latex code when adding the latex tag on stackoverflow. As one can see the code block syntax is not highlighted, even ...
gehbiszumeis's user avatar
  • 3,635
3 votes
1 answer
69 views

Set syntax highlighting for [biopython] to lang-py

Currently, biopython does not have a syntax highlighting language set. Since this is a Python package, I'd like to request that it be set to lang-py, as there are a number of biopython questions that ...
MattDMo's user avatar
  • 102k
3 votes
1 answer
703 views

Syntax highlighting for Java properties?

Is there a syntax highlighting language hint (<!-- language: lang-??? -->) for Java properties? Or can a hint for another language/format be used for this purpose? Example snippet to which syntax ...
howlger's user avatar
  • 32.4k
3 votes
1 answer
187 views

What library is used for "special comments" for code blocks

At Stack Overflow, we can use special comments to indicate language of indented code blocks. I mean, the comments like <!-- language: lang-js --> and <!-- language-all: lang-html --> ...
john c. j.'s user avatar
3 votes
1 answer
101 views

C preprocessor macros are treated as comments in code blocks?

Am I doing this wrong, or is the syntax coloring support for macros subpar? They look to be treated as comments when the argument is only a single word, but multi-word arguments are highlighted ...
jtbandes's user avatar
  • 117k
3 votes
1 answer
99 views

Syntax highlighting override doesn't work on iOS app

I posted this answer today on meta and used the following to force the SQL syntax highlighting: <!-- language-all: lang-sql --> Which works as expected on desktop. However on the iOS app it ...
SierraOscar's user avatar
  • 17.5k
3 votes
1 answer
47 views

How to edit the inferred language for a tag?

Is it possible to add the inferred syntax highlighting language to a tag, and if so, how? This came to mind when writing an answer to a gulp-related question. I had to specify the language manually, ...
Edward Brey's user avatar
3 votes
1 answer
95 views

Let's assume that gradle code snippets are written in Groovy

Code snippets in gradle-tagged questions are most likely to be written in groovy, so I suggest to make groovy default code language for syntax highlighting in this case. Based on discussion related to ...
shabunc's user avatar
  • 24k
3 votes
1 answer
52 views

How to highlight patterns in the text of a question?

I just edited a question where the description says something like (not quoting to show the difference properly): If I want to find all the instances of, say, "th" in a number of files you do: I ...
fedorqui's user avatar
  • 283k
3 votes
1 answer
96 views

Visual C++ should default to lang-cpp

The default syntax highlighting (prettify) is now listed at the bottom of the tag wiki. I noticed that visual-c++ (go to the tag info) is probably wrong. It is set to use lang-c instead of lang-cpp. ...
Mark Hurd's user avatar
  • 10.9k
3 votes
1 answer
90 views

Syntax highlighting, lang-objc and objc not a language?

According to comments in Revisions to What is syntax highlighting and how does it work?: There is no "objc" keyword. Please don't add things unless you actually know for sure. Prior to adding the "...
jww's user avatar
  • 100k
3 votes
0 answers
128 views

Could you please add the `pine` language code to three tags? [duplicate]

I would like to implement highlighting for Pine Script™ code, which is typically used in the following tags: pine-script pine-script-v4 pine-script-v5 Could you please associate the pine language ...
PineCoders-LucF's user avatar
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 ...
shreyasm-dev's user avatar
  • 2,796
3 votes
0 answers
91 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 ...
Paulo's user avatar
  • 9,725
3 votes
0 answers
90 views

Posts with only ansible tag has no syntax highlighting

There is no syntax highlighting in posts for only ansible tag, it looks so poor to read unless you add yaml tag or language directive. I think this should be solved
Orkhan Alikhanov's user avatar
3 votes
0 answers
62 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 ...
Tomer Shetah's user avatar
  • 8,483
3 votes
0 answers
74 views

New code formatting engine has some weirdness [duplicate]

I am seeing a bit of weirdness with the new code formatting library on this Stack Overflow question: Phone Number Regex Conditions Here is how my answer is being formatted: As you can see, something ...
Tim Biegeleisen's user avatar
3 votes
0 answers
47 views

Syntax highlighting for the processing tag

processing is a simplification of Java design to help teach programming principles to non-programmers. Can we apply the Java syntax highlighting to posts tagged with it by default?
Mureinik's user avatar
  • 303k
3 votes
0 answers
103 views

The syntax highlighting language for [cocoa-touch] is incorrect

For cocoa-touch (wiki here) The current language tag ("lang-C") is completely incorrect If (for some reason) have to have a language tag on cocoa-touch, it is either swift or obj-C It seems, it ...
Fattie's user avatar
  • 17.1k
3 votes
0 answers
82 views

There isn't highlighting on a profile's page description

I don't know if this is intentional, but the description on profile page didn't highlight, even using the correct formatting, as below: This might be a bug since while we're editing our ...
Brhaka's user avatar
  • 1,642

1
3 4
5
6 7