Questions tagged [syntax-highlighting]
For questions about the syntax highlighting performed inside code blocks on Stack Exchange sites.
336
questions
9
votes
0
answers
88
views
Add code highlighting for the Ballerina tag [duplicate]
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 ...
4
votes
1
answer
63
views
Code coloring not working correctly?
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 ...
7
votes
0
answers
116
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, ...
8
votes
0
answers
110
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" ...
3
votes
1
answer
71
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:...
2
votes
0
answers
118
views
Add syntax highlighting for Django templates (already supported by highlight.js)
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 ...
1
vote
1
answer
85
views
Syntax highlighting not working on one particular page, with warnings logged to console [duplicate]
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 ...
8
votes
0
answers
56
views
Clarify "Syntax highlighting for code": specify where to put "language-all:" directive
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 ...
7
votes
0
answers
87
views
There is italic in the code blocks (bug) [duplicate]
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^...
5
votes
1
answer
236
views
Is C# syntax highlighting broken?
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....
2
votes
0
answers
63
views
Syntax Formatting Bug with Method Parameter Attributes in C# [duplicate]
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 ...
1
vote
1
answer
113
views
Add default syntax highlighting for [excel-formula] tag
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 ...
2
votes
0
answers
84
views
HTML syntax highlighting on JavaScript questions
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: ...
8
votes
1
answer
152
views
Change Default Syntax Highlighting for [typescript] from lang-js to lang-typescript
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, ...
2
votes
1
answer
190
views
HTML formatting inside highlighted code blocks is no longer supported - how can I fix my posts?
In the past, it used to be possible to apply rich text formatting to text inside code blocks, as long as the code block was formatted using the HTML <pre><code> elements. As an example, ...
3
votes
0
answers
232
views
Is having the ability to apply rich text formatting inside code blocks important?
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 ...
8
votes
1
answer
152
views
Syntax highlighting for numbers
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 ...
5
votes
0
answers
88
views
Syntax highlighting Java code in response to a Kotlin question
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 ...
8
votes
0
answers
185
views
Request to set the TOML tag to default syntax highlighting to lang-ini
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 ...
8
votes
1
answer
137
views
Why does TOML code block formatting look so bad?
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 ...
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 ...
3
votes
0
answers
90
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 ...
5
votes
0
answers
42
views
Set lang-js as the default syntax highlighting for [react-native]
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 ...
6
votes
1
answer
148
views
How to manually specify language of a fenced code block in Teams?
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 ...
2
votes
1
answer
74
views
Automatic syntax highlighting for [fortran] [duplicate]
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 ...
0
votes
1
answer
49
views
The [libgdx] tag should syntax highlight for Java
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 ...
4
votes
0
answers
89
views
TypeScript syntax highlighting broken in this question [duplicate]
The problematic code (with lang-typescript code fence):
type ParseFunc<OutT, InT> = (val: InT) => OutT;
declare const parseString: ParseFunc<string, unknown>;
declare const ...
9
votes
0
answers
228
views
What's wrong with this CSS code so syntax highlighting seems to break?
As for the closing/re-opening: a) my question is about grid properties breaking the CSS rendering, not about CSS custom properties causing a comparable issue; b) the duplicate doesn't even have any ...
10
votes
0
answers
206
views
Wrong syntax highlighting halfway through a Python identifier [closed]
Update: This is actually a bug with highlight.js, but I was testing with an older version that didn't have the problem. I submitted a bug report.
Syntax highlighting changes halfway through a Python ...
4
votes
0
answers
107
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 ...
70
votes
0
answers
905
views
Support x86asm as a highlighted language
I would like to see x86 asm (Intel syntax) supported as a highlighted language.
It is already supported by highlight.js as x86asm, and there are more than 15,000 questions in the x86 tag alone and ...
5
votes
1
answer
162
views
Nonsense formatting of asm snippet
In an answer I wrote I have a code block containing asm code, starting with ~~~nasm (I also tried just ~~~), and it produces nonsense formatting of the assembly:
I have no clue what's going on, the ...
5
votes
0
answers
85
views
JavaScript highlighting is incorrect when defining buffers with numbers in them [duplicate]
I have noticed that JavaScript in questions on Stack Overflow isn't quite highlighted correctly. I saw this in the following code:
function getFileType(data) {
let dataView = new Uint8Array(data);
...
5
votes
0
answers
69
views
CSS variables are not syntax-colored correctly
As you can see here and below, the variable names starting with --something- are not colored appropriately.
20
votes
0
answers
417
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 ...
37
votes
0
answers
617
views
The STL tag uses the wrong language for syntax highlighting
The stl tag lists C as the language used for code highlighting ("Code Language (used for syntax highlighting): lang-c" on the tag wiki page). This is the incorrect language, as it should be &...
5
votes
0
answers
186
views
Add syntax highlighting for AutoHotkey (ahk) code blocks
Currently, AutoHotkey (ahk) code blocks are not syntax highlighted, like the following code:
#z::
MsgBox The Win-Z hotkey was pressed.
Gosub MySubroutine
return
MySubroutine:
Sleep 1000
return
While ...
18
votes
0
answers
140
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 ...
8
votes
3
answers
240
views
Visually distinguish code highlighting tags
Recently I'm encountering more and more questions that contain a significant amount of code but due to the poor/lazy choice of tags, the code is usually not highlighted. When the question contains ...
5
votes
0
answers
121
views
Code highlighting bug [duplicate]
I'm using Safari on my iPad to browse Stack Overflow.
Everything is completely fine, but sometimes I get a problem where only half of the code is highlighted like this:
Or this:
I'm not sure if it ...
5
votes
0
answers
104
views
Add CSS rules for syntax highlighting of operators
The current syntax highlight is somewhat minimal, because the engine (unlike some others) intentionally doesn’t highlight identifiers at all (unless they have a special meaning1).
In principle that’s ...
11
votes
0
answers
291
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 ...
31
votes
2
answers
860
views
The revision history does not show the latest content correctly
In this answer, I updated the name of the class from Testing to SpellCheck but the revison history, while looking it on inline mode, shows it as TestingSpellCheck.
It's shown correctly when using the ...
3
votes
0
answers
89
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
10
votes
0
answers
154
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 "...
0
votes
1
answer
476
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 ...
18
votes
1
answer
279
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 ...
9
votes
0
answers
259
views
TypeScript syntax highlighting seems broken in this question
I saw this question in my feed and noticed that despite the code being nominally correct, the syntax highlighting appears broken, starting at the generic type parameters to the arrow function.
I copy/...
6
votes
1
answer
174
views
Rendering issue in code before --
c / c++ most optimized solution needed plz provide the solution (is a terrible question), but has a section of the question where the last line of a code list before a -- is bold:
The markdown is
# ...
4
votes
1
answer
207
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 ...