Questions tagged [syntax-highlighting]

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

Filter by
Sorted by
Tagged with
20 votes
1 answer
318 views

Code block containing asterisks displaying in italics

Why is "DRSI" displaying in italics in this SO answer? I expect markdown to be disabled in code blocks, because some code happens to conform to certain markdown patterns. Interestingly, on ...
Bohemian's user avatar
  • 419k
20 votes
0 answers
429 views

Tag [svelte] should be syntax highlighted as lang-html

svelte is a web framework where components are expressed with HTML syntax. Here's an example of what Svelte code looks like from their website: <script> let count = 0; function ...
loops's user avatar
  • 5,235
19 votes
0 answers
228 views

Please make the font and color settings in the snippet editor match the result in the question's code block

I only noticed today that there is mismatch between the display in the StackSnippet editor: and the resulting HTML in the code block in the question: First of all, the color coding is different, and ...
Mr Lister's user avatar
  • 46.2k
19 votes
0 answers
549 views

Add the JavaScript language hint to the `reactjs` and `react-jsx` tags

Since React is a JavaScript library, questions that are tagged reactjs or react-jsx should utilize JavaScript syntax highlighting by default. Even in cases where React is used in a non-browser ...
Michelle Tilley's user avatar
18 votes
2 answers
528 views

C++ tag variants do not highlight syntax

C++ syntax highlighting does not work when c++03, c++14, c++17 or c++20 are used, unless c++ is added as well. However, it does work with c++11 alone so I know it is possible, and makes me think the ...
The Vee's user avatar
  • 11.5k
18 votes
3 answers
464 views

Do I remove syntax highlighting for sample input/output?

In many cases, a sample input/output data is given alongside the code, which shares the syntax highlighting (deduced from question tags), like this: How does this code #include <stdio.h> int ...
iBug's user avatar
  • 36.5k
18 votes
1 answer
310 views

/help/formatting says we use Prettify, but we use highlight.js now

https://stackoverflow.com/help/formatting says: Code blocks can be highlighted using Google Prettify. In many cases, the syntax highlighting language will be inferred from the question's tags. But ...
nekketsuuu's user avatar
  • 1,899
18 votes
0 answers
171 views

Add support for F# syntax highlighting

Currently f# is not fully supported. F# on this site uses ML as Syntax Highlighting by default. F# is a descendant from ML, but still is a lot different. For example, simple Line Comments for F# code ...
David Raab's user avatar
  • 4,468
18 votes
0 answers
235 views

Include CMake syntax highlighting in Highlight.JS

This has been going on for a while now, but I was just motivated enough today to raise the issue. See an answer I wrote here for an example: https://stackoverflow.com/a/68039135/2137996 I see "...
Alex Reinking's user avatar
17 votes
1 answer
435 views

bash doesn't format properly without language comment

I thought that the code formatter was supposed to default the language formatting if one of the tags matches a language. But I've found that in questions tagged bash I still need to write <!-- ...
Barmar's user avatar
  • 764k
16 votes
2 answers
440 views

Does SO use `highlight` or `highlightAuto`?

When reporting a syntax highlighting problem to highlight.js, one of the questions is: Are you using highlight or highlightAuto? What's the answer for SO?
T.J. Crowder's user avatar
16 votes
2 answers
515 views

Trailing backslash in strings breaks code formatting

I did not find an answer to this after searching a bit : On stackoverflow.com, is there a way to avoid breaking a code block's formatting when including a string with a trailing backslash ? It's ...
sodawillow's user avatar
  • 12.9k
15 votes
1 answer
195 views

Need automatic syntax highlighting for Pascal

I notice that questions which are tagged as pascal do not get automatic syntax highlighting (see e.g. this question). As a workaround one can add an inline tag: <!-- language: lang-pascal --> ...
Paul R's user avatar
  • 211k
15 votes
1 answer
654 views

Enable automatic syntax highlighting of PowerShell

Recently, PowerShell syntax highlighting has become available in SE posts. But one has to explicitly request that using <!-- language: lang-powershell --> It's not automatically used as with ...
Martin Prikryl's user avatar
15 votes
0 answers
245 views

Enable automatic and on-demand syntax highlighting for PowerShell (updated for highlight.js)

Note: After the discussion in the comments, a separate post was spun off from this one, linked to below. Note: This isn't a duplicate of earlier posts such as Enable a "lang-powershell" ...
mklement0's user avatar
  • 411k
15 votes
0 answers
306 views

Enable XQuery syntax highlighting (Prettify lang-xq.js)

I recently tried to add <!-- language: lang-xq --> to properly syntax-highlight a snippet of XQuery code in a StackOverflow question: for $n in Movies//Movie//OtherTitles let $d := ($n/...
Charles Duffy's user avatar
15 votes
0 answers
256 views

Can we add Ada syntax highlight?

Ada syntax uses ' notation for both character and attribute notation. Syntax highlighter tends to generalizing ' as beginning of a character or a string and the second one as end notation. lang-ada ...
Jossi's user avatar
  • 1,030
15 votes
0 answers
385 views

Syntax highlighting for Smalltalk [duplicate]

I just figured out this meta site could be a good place for asking why Smalltalk syntax is not highlighted in SO (even when tagged)? I have checked and most fashion programming languages are ...
Hernán's user avatar
  • 1,749
15 votes
0 answers
135 views

Enable default code highlighting in [rust] tag questions

I've asked for this feature on meta before it had been split into meta-stackoverflow and meta-stackexchange, however for some reason it was ignored. I thought it would be helpful to repeat it again ...
Vladimir Matveev's user avatar
14 votes
1 answer
258 views

Syntax highlighter gives up mid-word

macOS Mojave 10.14.6, Safari 14.0.2 - often only a part of the code is highlighted. After a certain point, the rest of the code won't be highlighted at all. Looks like only the code that fits in the ...
ForceBru's user avatar
  • 44.3k
14 votes
0 answers
175 views

Will Stack Overflow consider supporting third-party highlight.js packages?

One of the nice features of highlight.js is its plugin framework which adds support for third-party programming languages that are not supported by the main highlight.js development team. With Stack ...
Brad's user avatar
  • 3,894
14 votes
0 answers
635 views

Could Vue.js questions be adjusted to highlight correctly?

Currently, the vue.js tag does not automatically apply any syntax highlighting. I have reviewed these 2 posts: Meta SE - What is syntax highlighting and how does it work? Meta SO - What is syntax ...
zero298's user avatar
  • 26.2k
14 votes
0 answers
449 views

Add syntax highlighting for [thymeleaf] tag

The thymeleaf tag needs HTML syntax highlighting applied by default. It's an HTML template engine. Right now all the questions and answers are unnecessarily difficult to read with no syntax ...
ZeroOne's user avatar
  • 3,101
13 votes
2 answers
427 views

Syntax highlight apparently broken in edit preview and suggested edits queue

I think currently syntax highlight is broken for edit preview and the suggested edit review queue. This is the case for the majority of posts I've seen, it seems the exception are code fences with a ...
bad_coder's user avatar
  • 12k
13 votes
1 answer
2k views

How to compose yellow background blockquote?

Sometime I see questions or answers with a ivory/light yellow background blockquote to highlight or cited reference. What editing syntax can I use to achieve this result? And what's the official use ...
KDX's user avatar
  • 611
13 votes
1 answer
166 views

The process for assigning default prettifiers to new languages appears to be broken

I have personally been trying to get default prettifiers assigned to the tensorflow, keras, tensorboard, and julia tags in Stack Overflow for---in some cases---over two years now, and the discussions ...
Engineero's user avatar
  • 12.6k
13 votes
1 answer
285 views

Set the Code Language (used for syntax highlighting) for Swift tags

At the bottom of each tag info page, there is a Code Language (used for syntax highlighting). This is something that can be changed by moderators. Well, I'd like a few adjustments if possible: ...
Cœur's user avatar
  • 37.9k
13 votes
0 answers
127 views

Syntax highlighting is missing after new edits are shown [duplicate]

For the last couple of weeks I have observed the following issue on Stack Overflow: I open a new Chrome tab with a C# question to read it - the C# syntax highlighting is present. Someone edits ...
ASh's user avatar
  • 35.3k
12 votes
1 answer
660 views

'get' in a code tag does not render properly as a keyword [closed]

I found get in my code snippet does not properly render as a C# keyword. Is this a bug?
Display Name's user avatar
  • 14.7k
12 votes
1 answer
3k views

What is the default language for the syntax highlighter?

Just curious. What is the language the syntax highlighter defaults to, when it can't make out what it's about? You know, the one where lines starting with a # are comment. I did extensive research ...
Mr Lister's user avatar
  • 46.2k
12 votes
1 answer
159 views

Stack Overflow freezes when opening specific post on the desktop site

Not sure if this is universal but on my desktop, laptop, and phone desktop site when opening BigInt inconsistencies in PowerShell and C# I get stuck loading into the question and eventually getting a &...
Nico Nekoru's user avatar
  • 2,970
12 votes
1 answer
625 views

Syntax highlighting not working by default for CSS

Everytime I post CSS code on SO, I am slightly more annoyed by the incredibly incorrect syntax highlighting. So, I decided to make a post about it here. Every single other language has correct syntax ...
Joeytje50's user avatar
  • 18.9k
12 votes
1 answer
122 views

Syntax highlighting for Cake build scripts (tag cakebuild)

Syntax highlighting for Cake build scripts isn't available for questions tagged with just cakebuild today. The cakebuild should default to lang-cs just as c#, as it's 9 times of 10 C# build scripts ...
devlead's user avatar
  • 5,000
12 votes
0 answers
80 views

How about some automatic syntax-highlighting on meta?

AFAICS, there's just one tag on meta which has a high incidence of code in a predictable language: data-explorer How about we add a highlighting-hint for that?
Deduplicator's user avatar
  • 45.3k
12 votes
0 answers
280 views

C# code highlighting for "async" and "await" [duplicate]

Can we have code highlighting for async and await in C#? async and await was released with .NET Framework 4.5. Visual Studio 2012 introduces a simplified approach, async programming, that ...
Maximilian Ast's user avatar
12 votes
0 answers
243 views

Wrong default syntax highlighting in some tags

I noticed that two of my favorite tags have the wrong syntax highlighting assigned to them: clojure has lang-lisp syntax highlighter instead of lang-clj; coffeescript has lang-default syntax ...
Leonid Beschastny's user avatar
11 votes
1 answer
178 views

Syntax Errors in Code Renderer?

In this question about a syntactic impossibility in Java, I had to write a chunk of code that purposely contained a syntax error. After submitting the question, I was reasonably surprised because the ...
Clashsoft's user avatar
  • 11.7k
11 votes
1 answer
91 views

Python syntax highlighting for questions tagged [python-3.8]

Python 3.8 has been out for about five months now. Can someone make the python-3.8 tag trigger Python syntax highlighting? Note: similar requests for the python-3.4 tag, the python-3.5 tag, and the ...
Kevin's user avatar
  • 75.6k
11 votes
2 answers
867 views

Why is a Bash script not highlighted by Google Prettify

Note: I could not distinguish if this is a bug due to a wrong inclusion of Prettify, Prettify itself or wrong usage by me, since it is not explicitly documented on Prettify, how to properly format ...
Jankapunkt's user avatar
  • 8,263
11 votes
1 answer
257 views

Code Tag Association to Syntax Highlighting Request

Have looked at What is syntax highlighting and how does it work? and in my opinion Classic ASP should fall into the <!-- language: lang-vb --> hint. Being active in the asp-classic tag ...
user692942's user avatar
  • 16.5k
11 votes
0 answers
257 views

Syntax highlighting: Use "lang-bash" (or similar) as default language for tags [powershell] and [powershell-core] until PowerShell is fully supported

Note: There are related existing posts, but this one makes a concrete proposal that complements the feature-request post that asks for proper PowerShell syntax-highlighting support via highlight.js, ...
mklement0's user avatar
  • 411k
11 votes
0 answers
324 views

Inline formatting no longer works with syntax highlighting

Sometimes I use HTML <pre><code>…</code></pre> instead of Markdown ```…``` / ␣␣␣␣… blocks for code blocks with inline text formatting. I have noticed recently that such inline ...
Jon Purdy's user avatar
  • 54.2k
11 votes
0 answers
139 views

Assign JavaScript highlighting to [office-js] tag

The office-js tag is used for questions addressing Office Web Add-in's JavaScript library. Since the sample code in these questions is universally JavaScript, it would be helpful to have the office-...
Marc LaFleur's user avatar
  • 32.5k
11 votes
0 answers
154 views

Rust syntax - lifetime highlighting

It shows up in any snippet with explicit lifetimes - it formats lifetimes as though they were string literals fn lifetimes<'a, 'b: 'a>(x: &'b &'a str) -> &'a str { *x } ...
Djzin's user avatar
  • 1,218
10 votes
2 answers
1k views

PowerShell Syntax Highlighting

I mainly answer PHP questions where syntax highlighting has always worked for me with just indentation. I've just started using PowerShell and have asked a couple of questions and syntax highlighting ...
AbraCadaver's user avatar
  • 78.6k
10 votes
1 answer
83 views

What is the correct way to handle edits where a user highlighted "names" [duplicate]

So I came across this post (edit approval) and I noticed that it had been edited in such a way that many words (apparently names/key-words) became highlighted. Like: Android Android Studio SmartGit ...
Rolf ツ's user avatar
  • 8,661
10 votes
1 answer
389 views

Add Java syntax highlighting to [java-8] tag

Please can questions tagged java-8 be associated with Java-style syntax highlighting? Some questions specifically relating to Java 8 features don't include the java tag (list) and it would be nice to ...
Duncan Jones's user avatar
  • 68.5k
10 votes
3 answers
144 views

XAML formatting error when using <Style>

I have noticed in a few places that XAML code sometimes formats incorrectly like the third code block on this question. Am I doing something wrong or is this a bug with the code formatting? You can ...
Trisped's user avatar
  • 5,857
10 votes
1 answer
473 views

Go programming language syntax highlighting

From the go tag info for the Go programming language: Code Language (used for syntax highlighting): default Why doesn't it specify lang-go? are you sure that you've got the correct highlighting ...
peterSO's user avatar
  • 162k
10 votes
1 answer
170 views

Request to set GitHub Actions tag default syntax highlighting to YAML

Please set the default language for github-actions to lang-yaml. The workflows and actions for GitHub Actions are described in YAML files (for reference: https://help.github.com/en/actions/reference/...
riQQ's user avatar
  • 11.2k

1
2
3 4 5
7