Skip to main content

Questions tagged [syntax-highlighting]

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

Filter by
Sorted by
Tagged with
-4 votes
1 answer
209 views

How do I a highlight a Windows cmd code block? I've tried language tags in a code block on Stack Overflow: cmd, batch, batch-file, bat. Nothing works. I'm using triple backtick syntax: ```cmd echo %...
Basilevs's user avatar
  • 24.8k
18 votes
1 answer
141 views

Code - at least for C#, I haven't tried other tags yet - is barley readable due to poor contrast in dark mode on the redisigned pages: I'm using Firefox 148.0 on Windows 11
Bill Tür stands with Ukraine's user avatar
15 votes
0 answers
436 views

Today, I found this question and most of its answers to have wrongly auto-detected language attributes for most of the code blocks:[1] How to overwrite text in <p> tag using JavaScript - Stack ...
Wolf's user avatar
  • 10.4k
6 votes
1 answer
123 views

We can create syntax highlighting on stackoverflow with the following format: ```{language} code here ``` If the language is Python, you'll get syntax highlighting in preview, but not after you ...
btilly's user avatar
  • 47.9k
4 votes
0 answers
178 views

I've scourged this site for similar questions, but the closest one was this: Should we have syntax highlighting for AutoHotkey questions? But it does not really tackle the question well in that it ...
digitalguy99's user avatar
12 votes
0 answers
164 views

I've slightly edited this question. When I checked the final result, I noticed the Python code block was not properly highlighted. (I can't remember if it was before my edit.) It's correctly (I think)...
cafce25's user avatar
  • 30.1k
4 votes
1 answer
211 views

Lately I've noticed the syntax highlighting for typescript questions is not applying when the code fence hint ```ts or ```lang-ts is used. Example question - How to have TypeScript show computed/...
Phil's user avatar
  • 166k
2 votes
0 answers
65 views

Currently code blocks in questions tagged with zig (for Zig) do not get any syntax highlighting by default. Adding lang-zig to the opening triple backticks of the code block seems to enable some ...
mkrieger1's user avatar
  • 24.4k
3 votes
2 answers
260 views

COMMAND and OUTPUT is formatted as italics in this post. I know <pre><code> can be used to format text in code blocks, but that answer uses just a normal code fence ``` ```. Here's the ...
phuclv's user avatar
  • 43.5k
3 votes
2 answers
397 views

I have a question about my Stack Overflow post: How can I change a TextInput's selection and fire its onSelectionChange event in unit testing? I have some code blocks in my question and my self-...
Autumn Leaf's user avatar
3 votes
0 answers
124 views

When I view the code in Remove duplicate character from a string and keep only single occurrences using recursion , the first few lines look like so: Notably, the type name String is inconsistently ...
Karl Knechtel's user avatar
4 votes
0 answers
427 views

It is possible to ask for a new language to be available for code blocks? If yes, I feel that adding the hcl language identifier would be handy. There is a similar question somebody ask not too long ...
Clarence the Bard's user avatar
12 votes
1 answer
334 views

On main site Q&A, syntax highlighting works as soon as you add a relevant tag to the question like php, or a language hint before the code block: // This comment is grey. Other colors are below: ...
Laurel's user avatar
  • 6,266
1 vote
0 answers
39 views

Could we add language support for DAX to get syntax color coding when using: ```dax // code ```
Sam Nseir's user avatar
  • 13.2k
4 votes
1 answer
200 views

Can you please add a syntax highlighting hint for the C++ programming versioned tags such as c++20. It is generally recommended to use both c++ and the version-specific tag, and c++ already has this ...
Jan Schultke's user avatar
  • 45.2k
9 votes
1 answer
134 views

Every now and then, I come across C++ questions for which syntax highlighting is broken. For example: What's {} in void({})? renders as follows: This is obviously broken and should look like: ...
Jan Schultke's user avatar
  • 45.2k
10 votes
0 answers
139 views

Can we add Python syntax highlighting for questions tagged micropython? Some random examples of questions when this would be helpful: Update screen every hour Why isn't my ILI9488 touchscreen working?...
Jonas's user avatar
  • 131k
7 votes
0 answers
783 views

Tagging a fenced code block with powershell: ```powershell Write-Output "Hello, $Env:USERNAME" ``` produces no syntax highlighting: Write-Output "Hello, $Env:USERNAME" This ...
Pxtl's user avatar
  • 1,073
4 votes
0 answers
188 views

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 ...
user avatar
2 votes
0 answers
103 views

Previously code blocks on questions tagged with a single programming language were automatically highlighted using that programming language, unless an explicit language was specified (e.g. via code ...
Konrad Rudolph's user avatar
3 votes
0 answers
130 views

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
2 votes
0 answers
54 views

I guess that lang-cmake became available on Stack Overflow only recently. According to "What is syntax highlighting and how does it work?", moderators can assign syntax highlighting ...
Benjamin Buch's user avatar
6 votes
0 answers
193 views

Godot is becoming increasingly popular as a choice for a game engine, and it's also becoming popular in Stack Overflow as well: gdscript, godot It also has support with Highlight.js as well, and I ...
Tristan F.-R.'s user avatar
9 votes
0 answers
94 views

Currently, the Ballerina tag does not have code highlighting associated with it. Can we add the Ballerina language syntax highlighting to the questions that are tagged with ballerina? This question ...
ThisaruG's user avatar
  • 3,442
5 votes
1 answer
198 views

Just noticed an older answer of mine. As you can see here: the first code example has "some colors", the second one that is almost identical is all just white text. (using latest version of ...
GhostCat's user avatar
  • 141k
16 votes
0 answers
550 views

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
  • 456k
21 votes
0 answers
486 views

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
  • 456k
3 votes
1 answer
121 views

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
  • 13.5k
2 votes
0 answers
390 views

Django questions are pretty common on Stack Overflow. Many of them use Django templates. Django is supported by highlight.js but isn't supported by Stack Exchange. This isn't necessary, but would be ...
pigrammer's user avatar
  • 3,697
1 vote
1 answer
145 views

EDIT: Ignore the part about the console warnings; these were not actually relevant to the highlighting issue. The issue was caused by the absence of the 'swift' tag and resolved by another user ...
Quack E. Duck's user avatar
8 votes
0 answers
69 views

On the page Markdown help, section Syntax highlighting for code needs to be clarified. Original text: To specify a syntax highlighting language to be used not only for the next, but for all following ...
Timur Shtatland's user avatar
7 votes
0 answers
119 views

First time today I see some italic in a block code, e.g. here: from sympy import * from sympy.parsing.sympy_parser import * from sympy.abc import x,y,z,w,a,b,c,d eq = x*y + 1#parse_expr('((x^2+y^2+z^...
Stéphane Laurent's user avatar
5 votes
1 answer
477 views

See an answer I wrote here. The code is all in white, even though the question is tagged c# I also tried with the ```csharp syntax, and it's still white text TimeZoneInfo tz = TimeZoneInfo....
Matt Johnson-Pint's user avatar
2 votes
0 answers
63 views

Syntax highlighting of attributes on method parameters in C# seems buggy. The code at the bottom of this question doesn't render the first attribute correctly. I've replicated the code and provided a ...
ScottishTapWater's user avatar
2 votes
1 answer
270 views

We should add a default syntax highlighting language for excel-formula. Although highlight.js supports the Excel formula language, Stack Exchange does not (and I doubt this will change soon as this is ...
Greedo's user avatar
  • 5,665
2 votes
0 answers
125 views

It's common for questions tagged javascript to have answers containing HTML code snippets, but it seems like they often aren't being highlighted properly. For example, in Restart animation in CSS3: ...
12Me21's user avatar
  • 1,209
10 votes
1 answer
685 views

The current syntax highlighting for typescript is lang-js. This is presumably due to the fact that lang-typescript was not available in the mod dropdown menu of syntax highlighting options, however, ...
Henry Ecker's user avatar
  • 35.9k
6 votes
1 answer
1k views

This question isn't relevant anymore since the site once again supports HTML formatting inside code blocks. Stack Exchange implemented the plug-in workaround noted in the answer, to resolve an issue ...
gparyani's user avatar
  • 1,988
6 votes
0 answers
468 views

For many years, it's been possible to apply rich text formatting to code blocks inside posts by formatting the code block using the HTML tags <pre><code> and using more HTML tags inside ...
gparyani's user avatar
  • 1,988
8 votes
1 answer
280 views

I often post benchmarks and then the results look partly colored: Sometimes someone edits my post to change the syntax highlighting from default to text, and then it looks like this: I prefer the ...
Kelly Bundy's user avatar
  • 28.1k
6 votes
0 answers
207 views

I provided an answer to a question tagged kotlin and javafx. The code blocks in my answer were predominantly in Java. Without any language tags on the code blocks, the syntax highlighting for the Java ...
James_D's user avatar
  • 211k
9 votes
0 answers
512 views

As per the guidance in What is syntax highlighting and how does it work? If the tag doesn't have a highlighting language specified when it should, create a feature-request on your site's per-site ...
Henry Ecker's user avatar
  • 35.9k
8 votes
1 answer
368 views

I have a Stack Overflow answer here that includes a TOML code block. I have tagged the code fence: ```toml But the resulting highlighting looks very poor and does not even highlight the comments ...
johnthagen's user avatar
  • 9,429
3 votes
0 answers
54 views

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,916
3 votes
0 answers
92 views

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
  • 11.1k
5 votes
0 answers
91 views

React Native code is basically React code, so I'm extending an old request that was made for React (Add the JavaScript language hint to the `reactjs` and `react-jsx` tags) to React Native. Can we have ...
Rafael Tavares's user avatar
8 votes
1 answer
915 views

I am just getting started with Stack Overflow for Teams and the editor seems to be different. I type 3 backticks and a code block is automatically created, but the backticks disappear and I can't ...
Nikko Q's user avatar
2 votes
1 answer
96 views

I had assumed from Syntax highlighting for Fortran? on MSO and Please deploy Fortran syntax highlighting on MSE that Fortran syntax highlighting was not available on Stack Overfow. But this question ...
veryreverie's user avatar
  • 3,001
0 votes
1 answer
66 views

libgdx is known primarily as a Java game framework. Although Scala and Kotlin work with it when it's not being used with GWT, the majority of incoming questions have Java code in them. All of libGDX's ...
Tenfour04's user avatar
  • 95.4k
2 votes
0 answers
109 views

The problematic code (with lang-typescript code fence): type ParseFunc<OutT, InT> = (val: InT) => OutT; declare const parseString: ParseFunc<string, unknown>; declare const ...
Kannan Goundan's user avatar

1
2 3 4 5
8