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
10 votes
0 answers
105 views

Upgrade highlight.js library, due bad assembly code highlighting

When I edited a SO post, I noticed an error in highlighting assembly code sample. Not only formatting is not applied when using assembly nor x84asm language identifiers, but it looks bad even if using ...
Jerry's user avatar
  • 203
6 votes
1 answer
135 views

Syntax highlighting for Vimscript

A moderator on Vi & Vim SE recently announced syntax highlighting for lang-vimscript (seems to be synonymous to lang-vim) to be working: It looks like lang-vimscript is supported for code ...
Friedrich's user avatar
  • 163
4 votes
1 answer
170 views

Syntax highlighting of Makefiles

The syntax highlighting is bugged for Makefiles. As per https://meta.stackexchange.com/a/356459/1288919 I used: ```lang-makefile Current output for: https://stackoverflow.com/a/77223358/22510042 ...
Tripple Moon's user avatar
21 votes
0 answers
102 views

Support 'text' as an alias for 'none' in syntax highlighting

For years, it has driven me nuts, having to use ```text to deactivate syntax highlighting on most markdown-enabled platforms like GitHub, but ```none or ```lang-text specifically on Stack Overflow. ...
kriegaex's user avatar
  • 571
10 votes
0 answers
138 views

Groovy syntax highlighting

According to the list of supported languages for syntax highlighting, Groovy has been missing for many years, despite the fact that highlight.js supports Groovy and Groovy is not a particularly exotic ...
kriegaex's user avatar
  • 571
1 vote
1 answer
147 views

Funny colouring of Hexdump

I recently posted this question on apple.stackexchange which contains a hex dump, like this: 00000210: 616e 7369 6f6e 0a20 2020 2020 2020 5f08 ansion. _. Different to here (on Meta ...
user1934428's user avatar
4 votes
0 answers
127 views

Can you please add Pine to the list of "Language codes currently available on Stack Exchange"?

As a follow-up to this question on MSE and this one on MSO, I would like to know if it is possible to add Pine to the list of "Language codes currently available on Stack Exchange" appearing ...
LucF's user avatar
  • 77
4 votes
0 answers
34 views

Add confirmation for saving a tag's syntax highlighting change

♦ moderators have the ability to assign to every tag a default language for syntax highlighting (see the FAQ): When clicking the Save button, all that happens is that the button gets disabled, which ...
Glorfindel's user avatar
  • 252k
3 votes
0 answers
216 views

Add syntax highlighting support for Solidity

Recently, I have been active a lot on the Ethereum site. It got a recent design overhaul which shows that some progression is happening. Unfortunately, one of the main issues is that the Solidity code ...
Throvn's user avatar
  • 131
7 votes
1 answer
132 views

Is the language name case sensitive for syntax highlighting?

I often use the syntax-highlighting feature of Stack Exchange in order to make my code easier to read. ```lang-python for k in range(0, 10): print(k) ``` for k in range(0, 10): print(k) ...
Toothpick Anemone's user avatar
5 votes
1 answer
196 views

Why does "lang-bash" not highlight a list of commands and their output but adding the [bash] tag to a question does?

Why does <!-- language-all: lang-bash --> not highlight a list of commands and their output (like it used to) but adding the [bash] tag (instead) to a question does? Example question: FQDN ...
SebMa's user avatar
  • 181
0 votes
0 answers
119 views

Why is my Python code not highlighted? [duplicate]

I have posted the following code in my question: import numpy as np for i in range(3): n = np.random.randint(2, 10000) m = np.random.randint(1, n) A = np.random.randn(m, n) * ((1 / m) ** ...
BinChen's user avatar
  • 119
12 votes
1 answer
215 views

Syntax highlighting changes in the middle of a token; resolved in a later version of Highlight.js

The code in my answer over at Stack Overflow highlights very strangely: I discovered this at Stack Overflow, but it affects just as much all other Stack Exchange sites with highlighting enabled (I ...
user3840170's user avatar
  • 4,080
2 votes
0 answers
76 views

Explicitly use Highlight.js auto detected language for a code block [duplicate]

Highlight.js does a reasonable job of automatically highlighting blocks of code in an unknown language. Sometimes as I'm writing a post which has blocks from multiple languages, console commands, log ...
Greedo's user avatar
  • 469
6 votes
1 answer
669 views

HTML formatting inside code blocks doesn't work if syntax highlighting is being performed for the block

I have plenty of old answers where I used <pre><code> to format code, with HTML tags such as <b> or <strike> inside such blocks. That has been broken for some time now, on SO ...
Erwin Brandstetter's user avatar
17 votes
2 answers
365 views

The "Code Language" selection on the tag wiki page isn't in sync with available and supported syntax highlighting options

Moderators can set the default syntax highlighter on tags by selecting a value from a drop-down list: The community maintains a list of supported languages by inspecting the Highlight.js code file ...
rene's user avatar
  • 90.8k
11 votes
0 answers
145 views

Support Prolog in syntax highlighting

As listed here, Prolog is not currently supported by Stack Exchange but it is supported by the underlying library highlight.js.
bmitc's user avatar
  • 211
7 votes
0 answers
195 views

Java properties file syntax highlighting

Many Java-related questions have code blocks in Java properties file format. Right now, in order to ensure they're not improperly highlighted as Java code, the plain text lang-none language code can ...
M. Justin's user avatar
  • 1,146
8 votes
1 answer
129 views

Incorrect syntax highlight in review audit

Today I found a review audit that apparently had incorrect syntax highlight. To me this seemed like a rare case so I decided to post it here as a possible bug or support question. This is the review ...
bad_coder's user avatar
  • 27.2k
3 votes
0 answers
130 views

Is lang-bash syntax highlighting not working anymore?

I have used <!-- language-all: lang-bash --> in one of my questions here, but the syntax highlighting does not seem to work anymore. EDIT 0: I changed it to <!-- language: lang-bash --> in ...
SebMa's user avatar
  • 181
4 votes
1 answer
182 views

Some lines of code block are bold when the question has at least two language tags

We've found this problem in this question on Stack Overflow in Portuguese, but I've also tested in other sites (English and Spanish SO's), and it happened there as well. In the aforementioned ...
hkotsubo's user avatar
  • 2,313
9 votes
0 answers
209 views

Add Gherkin syntax highlighting (e.g. Cucumber, SpecFlow and similar implementations)?

Per the accepted answer to What is syntax highlighting and how does it work?, I am raising a new feature request here as this is supported by highlight.js, but does not appear to work on Stack ...
Greg Burghardt's user avatar
3 votes
0 answers
62 views

CMake Syntax Highlighting

I see that highlight.js supports cmake, but highlight-loader.js currently doesn't make use of it. I'm attempting to follow the directions given here: https://meta.stackexchange.com/a/184109/159385
bukzor's user avatar
  • 131
9 votes
3 answers
2k views

Syntax highlighting for Excel Formulae - language suggestions

Based on most popular answer: Tl;dr: to use the Swift language rules, add <!-- language-all: lang-swift --> to the top of your post, or use ```lang-swift at the beginning of each code block ...
Greedo's user avatar
  • 469
16 votes
0 answers
126 views

Syntax highlight request: Elixir

I'd like to request that Elixir syntax highlighting support is included in StackOverflow's HighlightJS bundle and applied to the [elixir] tag. It is supported by HighlightJS and would add about 2.23 ...
Andrew France's user avatar
4 votes
0 answers
146 views

AutoIt syntax highlighting

I was working on an answer to Is there a way to ping a Bluetooth device from Windows?. And I was wondering why AutoIt syntax highlighting on Stack Exchange sites is so "poor". I was ...
Michał Lipok's user avatar
0 votes
0 answers
28 views

How to disable syntax highlighting in Markdown fenced code blocks [duplicate]

For indented code blocks, adding <!-- language: lang-none --> disables syntax highlighting. What about for fenced code blocks? Can I use lang-none or none in fenced code blocks too? Which of the ...
Flux's user avatar
  • 749
19 votes
1 answer
2k views

Adding GraphQL syntactical highlighting for code blocks

I went to post a question on Stack Overflow and provided a code block of GraphQL code. I tried doing something like: ```gql ... ``` and ```graphql ... ``` to get some syntax highlighting and didn't ...
triplethreat78's user avatar
38 votes
0 answers
282 views

Please deploy Fortran syntax highlighting

Fortran is supported by highlight.js. There are several Fortran questions at Stack overflow every day. Please enable Fortran syntax highlighting.
Vladimir F Героям слава's user avatar
4 votes
1 answer
796 views

Is it possible to copy formatted text from Stack Overflow posts/answers, i.e. colors, fonts, etc.?

I'm attempting to copy and then paste code examples from existing Stack Overflow posts into personal documentation which I often end up using Word to paste into. I find that I often am having to copy ...
Code Novice's user avatar
127 votes
1 answer
3k views

Julia syntax highlighting

Since the syntax highlighter is now highlight.js it would be great to finally get some syntax highlighting for Julia code on Stack Overflow and other sites that might need this tag. Julia is one of ...
fredrikekre's user avatar
  • 1,291
91 votes
2 answers
2k views

Stop guessing/auto-detecting a language when you KNOW it will be incorrect

The problem: SE asks Highlight.js to autodetect the language when it knows there isn’t any optimal/correct choice for us to make - resulting in very poor outcomes. Disclaimer: I say this as the ...
Josh Goebel's user avatar
  • 1,609
35 votes
1 answer
388 views

Syntax Highlighting FAQ List Updates

Update: I've gone ahead and updated the FAQ with the specified changes I recently became aware of the fact that the full list of language identifiers for the syntax highlighter on SE is a bit... ...
zcoop98's user avatar
  • 9,615
3 votes
1 answer
194 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....
user avatar
6 votes
0 answers
185 views

Add syntax highlighting support for Dockerfiles

Highlight.js supports syntax highlighting Dockerfiles, but support is not present on Stack Exchange’s version of highlight.js. Please consider adding support for this. Example question on Stack ...
pygeek's user avatar
  • 271
4 votes
0 answers
163 views

Add syntax highlighting support for Nim

Highlight.js supports syntax highlighting for Nim here. Questions on Stack Overflow for [nim-lang] currently have no highlighting support, and this would be a valued feature for users.
shirleyquirk's user avatar
33 votes
1 answer
537 views

Can Stack Overflow please upgrade to a version of highlight.js that supports PowerShell syntax highlighting?

This question is not a duplicate of: Enable a "lang-powershell" option for Prettify on Stack Overflow Please add support for PowerShell syntax highlighting They are from a time when Stack ...
TessellatingHeckler's user avatar
11 votes
0 answers
1k views

Add syntax highlighting support for nginxconf

Highlight.js supports syntax highlighting for nginx configuration files, but support is not present on Stack Exchange’s version of highlight.js. Please consider adding support for this. Example ...
pygeek's user avatar
  • 271
9 votes
0 answers
476 views

Syntax highlighting language request: Python REPL

Highlight.js treats Python REPL (the Python interpreter in interactive mode) as its own language separate from Python—it uses the class names python-repl and pycon. I checked Stack Exchange's ...
Ty Mick's user avatar
  • 99
10 votes
0 answers
116 views

Support more highlight.js language formatters

I'm not quite sure what Prettify was doing before, but now tcl questions seem to be getting highlighted in a pretty random set of choices. For an example, https://stackoverflow.com/revisions/64192481/...
Donal Fellows's user avatar
2 votes
0 answers
36 views

Fixing complex syntax highlighting of existing posts [duplicate]

I noticed when reading Goodbye, Prettify. Hello highlight.js! Swapping out our Syntax Highlighter that the syntax: <!-- language: lang-foo --> something in the Foo programming language is ...
Donal Fellows's user avatar
37 votes
2 answers
2k views

Improving syntax highlighting language auto-detection

highlight.js's current auto-detection is arguably poor, due in large part to the large number of available languages it has to pick from when not given a language hint. I suggest that when the ...
CertainPerformance's user avatar
21 votes
2 answers
509 views

Please default to TypeScript formatting for TypeScript posts

Right now, the default language formatter used for posts using the typescript tag is JavaScript, not TypeScript. As a result, TypeScript isn't very well formatted sometimes (an image because the tag ...
T.J. Crowder's user avatar
1 vote
0 answers
76 views

Please update syntax coloring to support underscores in JavaScript number literals [duplicate]

1000000 1_000_000 Both these literals are modern ways to represent the same number, but the syntax coloring stops at the underscore. I hope this can be fixed. Turns out the answer is: Stack Exchange ...
GirkovArpa's user avatar
13 votes
1 answer
585 views

What happened to Groovy syntax highlighting?

On Stack Overflow I have answered many questions about Spock and Geb, two Groovy test frameworks. For years, I have used <!-- language: lang-groovy --> in combination with indentation by four ...
kriegaex's user avatar
  • 571
37 votes
1 answer
583 views

New highlighting is suboptimal for colorblind individuals

Within the last like hour or so, the highlighting for many languages appears to have changed. Browsing questions now, I'm seeing code like this: And this: I have to say, as a red/green colorblind ...
Carcigenicate's user avatar
19 votes
1 answer
233 views

Could we include the Stack Exchange Highlight.js theme in the Highlight.js core package?

Once the final theme is agreed upon would Stack Exchange be open to submitting a PR to add the theme "officially" to the core project so smaller sites who enjoyed your theme could use it on ...
Josh Goebel's user avatar
  • 1,609
317 votes
38 answers
57k views

Goodbye, Prettify. Hello highlight.js! Swapping out our Syntax Highlighter

Update 2020-09-24 This is now live network-wide. Update This is now live on Meta Stack Exchange and Meta Stack Overflow. Any bugs and feedback can be posted here as an answer. I’m Ben and I’m a dev ...
Ben Kelly's user avatar
  • 5,407
8 votes
0 answers
117 views

Syntax highlighting is lost after collapsing and expanding the revision history

When I visit https://sometopic.stackexchange.com/posts/postId/revisions and click on ▼ to collapse the revision and then ▶ to expand, the syntax highlighting is lost after some milliseconds. After ...
Kulfy's user avatar
  • 1,847
10 votes
1 answer
117 views

Backslash before single quote breaks syntax highlighting (the quote is not escaped, but gets highlighted as if it is) in SEDE query

I was trying to write a query to find posts with <%break%> or <%%>, and realised that % works as a glob. Someone suggested using ESCAPE '\' to search for literal %, and that worked and the ...
Zanna's user avatar
  • 3,047

1
2 3 4 5
10