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
1answer
82 views

Why doesn't the syntax highlighting work?

I tried several ways of how to do syntax highlighting for R in this question, but it doesn't work. I tried ```R (see revision 3 of the question) and <!-- language: R --> (see revision 2) but ...
3
votes
1answer
96 views

Where is the list of language names supported by the markdown fenced code blocks?

Related to Implement ```-style (fenced) Markdown code blocks On this answer I used ```makefile and it is "working" the highlighting: However, on this other answer, I am also using ```makefile and it ...
11
votes
1answer
101 views

Clicking to reload an updated answer removes the code snippet buttons and removes syntax highlighting

If you are looking at an answer with a code snippet in it, and the answerer updates the answer, you see An edit has been made (etc.). If you click that, the answer is refreshed, but the code snippet ...
1
vote
0answers
22 views

Swift multiline strings are not formatted correctly [duplicate]

Swift multiline strings that contain quotation marks, such as: let multilineString = """ "let myString = 123" is part of my multiline string """ are formatted ...
12
votes
0answers
96 views

The plurals tag has lua syntax enabled

For some obscure reason - the plurals tag has lua syntax enabled. This ought to be fixed, since it might get confusing if for some reason there's code in a question with such tag. Could we remove ...
1
vote
0answers
31 views

XML syntax highlighting bug for “<style>” elements [duplicate]

The following XML fragment has incorrect syntax highlighting for comments and nested attributes: <style name="MyApp.ActionBarTheme" parent="@style/ThemeOverlay.ActionBar"> <!-- This ...
7
votes
0answers
40 views

Syntax highlight and MathJax is not rendered after reloading an edited post

I don't know how long this has been happening, but I recently noticed what seems to be a regression: after clicking the "An edit has been made to this post" banner that appears when a question or an ...
8
votes
0answers
93 views

Kotlin highlighting?

I motion to reopen Support Kotlin in code highlighting as there's a lot of evidence It says If Kotlin becomes more popular in the future, we will reconsider. Evidence of maturity There's a ...
-9
votes
1answer
69 views

Java Syntax highlighting on Stack Overflow not working [closed]

I posted a Java question with Java code: My custom made Stack class is always throwing StackIsUnderflowing Exception : Why? Then I selected the code and used the curly brace button and a language: ...
6
votes
0answers
60 views

“How to format” block mentions syntax highlighting even if it is not available on the site

When you edit the body of a post, the "How to Format" widget is shown in the right sidebar. It mentions the syntax highlighting function, even on sites which don't have syntax highlighting enabled ...
1
vote
2answers
123 views

Syntax coloring not working on the syntax highlighting FAQ page

The syntax highlighting FAQ page shows code samples in all black text. Is something broken with the syntax coloring feature? Here's what I see on What is syntax highlighting and how does it work? ...
12
votes
0answers
87 views

When does SE update their google-code-prettify builds?

Developers in the Elixir community have been trying to get Syntax Highlighting support for the Elixir Language on Stack Overflow and other Stack Exchange websites since 2013: We have gone through all ...
9
votes
1answer
759 views

Which Stack Exchange sites have syntax highlighting enabled?

The code syntax highlighting feature is only enabled on certain sites. In order for code to be highlighted and for any of the hints listed in the above question to work, the Markdown extension has to ...
9
votes
0answers
97 views

Syntax highlighting for DataScience SE [duplicate]

The Data Science SE site requires syntax highlighting feature as the posts contain code from multiple languages/syntaxes including but not limited to Bash, Regex, Python, Julia, Java, R. We collected ...
1
vote
0answers
167 views

Syntax highlighting for shell sessions? [duplicate]

Edit: I've opened an issue for this in the code-prettify project on GitHub. The author of the question Why does bash login shell break here-doc command string argument? noted in the comments that: ...
1
vote
0answers
35 views

Syntax highlighting for form elements sometimes do not work [duplicate]

I posted a question that has this code <input type="text" v-model="myVar" @keyup.enter="doFilter" /> <button class="md-icon-button md-raised md-accent md-dense" @click="doFilter">Filter&...
0
votes
0answers
26 views

Syntax highlighting hints not working for in-line code [duplicate]

It appears that manual syntax highlighting hints aren't working properly for in-line code samples. If I specify the language for my question using <!-- language-all: lang-java -->, the language ...
60
votes
1answer
2k views

Support Kotlin in code highlighting

The relevant PR was merged into code-prettify: https://github.com/google/code-prettify/issues/491 As per instructions, I'm asking to deploy it to the network and assign to kotlin tag.
2
votes
0answers
61 views

JavaScript syntax highlighter does not highlight template literals correctly

The lang-js highlighter does not appear to recognize backticked strings properly: let s = `a a a 'a a a' "a a a" a a ${true}`; // not quite let t = `a a a 'a a a ${true}'`; // a little ...
2
votes
0answers
189 views

Escape backslash inside string for syntax highlighting

This question has a block of code containing a string like "\foo\". The syntax highlighting (reasonably enough) assumes the \" is an escaped double-quote and continues the highlighting for string for ...
2
votes
0answers
18 views

Inconsistent code highlighting on the iOS app

I've noticed a few posts with code blocks that aren't getting any syntax highlighting when they should. This Q&A for example has no highlighting: Whereas this Q&A does: The strange ...
4
votes
0answers
120 views

Add syntax highlighting for the Makefile language

I want to post a question with a significant chunk of Makefile code, but the preview given from my code isn't very exciting, and it highlights seemingly random words here and there. The seemingly-...
1
vote
0answers
49 views

Syntax highlighting for unimplemented languages by introducing aliases of lang-none

Today I "struggled" with misleading syntax highlighting of markdown code examples, the problem was that using lang-none changes the colouring so that a previously unaffected markdown example looked ...
12
votes
0answers
60 views

A Stack Exchange fork of Google Prettify

Please consider maintaining (y)our own fork of Prettify. I just tried to add new keywords for Swift¹ but they wanted me to sign a CLA with all kinds of personal information and the project does ...
10
votes
1answer
105 views

What reputation is needed to suggest language hints to be used for particular tags?

In What is syntax highlighting and how does it work? it says: If you're curious whether a tag has a language hint, any user is capable of checking by visiting that tag's wiki page. The language ...
1
vote
0answers
25 views

Is there a language/syntax highlighting setting for diff? [duplicate]

I'm trying to ask a programming question about an internal IDE project file that is changed when files are added and removed from the project (References to Removed Framework in project.pbxproj File). ...
9
votes
1answer
270 views

Create Verilog Syntax Highlighter

According to the question Enable Verilog syntax highlighting, it is clear how to enable the syntax for various languages. That is not what this question is about, nor is it a duplicate of that. ...
5
votes
1answer
67 views

Code blocks are not prettified on mobile site

On Chrome on Android, code blocks on the mobile site have no syntax highlighting, are not a monospaced font, and words are wrapped. Mobile site on mobile browser: Desktop site on mobile browser: ...
1
vote
0answers
71 views

How to change the default code colour theme on Stack Overflow?

I understand that Stack Exchange is using Google Prettify as its engine. I don't like the default them and I found some colour themes for it. I did try it myself first and when I import my .css file ...
14
votes
2answers
118 views

How to get syntax highlighting activated on another SE site?

It seems syntax highlighting is not enabled on every SE site, but later on turns out to be rather advantageous. As an example, Graphic Design may not have sounded like needing it, yet there is a ...
3
votes
0answers
57 views

Stack Overflow Syntax Highlighting Bug on Android Application [duplicate]

Update I am now seeing that the text is being coloured correctly on my PC system and the issue seems to be only with the Android application. Either the issue is an intermittent one or I was simply ...
6
votes
1answer
70 views

Can a user script modify or apply syntax highlighting in SE sites?

SE currently use Prettify for syntax highlighting. However, there are still some languages which have no support from default Prettify, or by the extensions that SE may be using. If I wanted to test ...
4
votes
0answers
29 views

Document required blank line before language hint in Markdown help

As per Python's “//” operator wrongly treated as a comment (part 3), there must be a blank line before a language hint — otherwise, the hint is silently ignored. Markdown Editing Help doesn'...
148
votes
1answer
4k views

Highlight.js: For Real, Please

Background: SE currently uses the Google code-prettify library for syntax highlighting. The possibility of switching has been suggested in the past: Why doesn't StackOverflow use Highlight.js ...
2
votes
0answers
44 views

Can we add the triple backticks feature for code formatting in markdown? [duplicate]

Disclaimer: My request is about using the same markdown format used in GitHub for code blocks and syntax highlighting. In most recent markdown formatters, other than the 4 space indentations, we can ...
4
votes
0answers
56 views

Why is syntax highlighting not working for my Perl script? [closed]

In this post I added a perl script. This script works and is correctly highlighted in all the editors that I tested in. Yet still highlighting doesn't seem to work as expected on SO. From this line ...
2
votes
0answers
40 views

Syntax-highlighting comments are very picky about the number of spaces inside them

It seems that the comments for setting the syntax-highlighting of a code block require a space after the language:. This works: <!-- language: lang-or-tag-here --> This doesn't work: <!-- ...
4
votes
1answer
49 views

Why isn't this language hint working?

In the following answer I've inserted this language hint <!-- language-all: lang-html --> However, it is not picking it up and therefore not formatting it with HTML syntax colours. https://...
1
vote
0answers
13 views

iOS app syntax highlighting issues [duplicate]

I have noticed that the iOS app isn't highlighting syntax correctly, even with the explicit comment: <!-- language: whatever --> For example, compare this question in Chrome for iOS (47.0.2526....
3
votes
1answer
49 views

Wrong XML Comments in Code-View

It seems there is a bug in the XML-Code-Viewer in StackOverflow: See the related post: doFilter HttpServletRequest return null In XML comments are made by <!-- Comment --> Apparently there ...
2
votes
0answers
110 views

Update Google Prettify to get highlight support for Logtalk and Prolog code

Recent versions of Google Prettify include highlight support for the Logtalk programming language, which can also be used for the Prolog programming language (Logtalk syntax subsumes Prolog syntax).
6
votes
0answers
64 views

Add the lang-mumps module from Prettify

As of late, I have been writing a number of answers on CodeGolf.SE, using MUMPS (or a close variant) as my language of choice. MUMPS tends to look remarkably like line noise, whether or not you're ...
22
votes
2answers
365 views

Syntax highlighting: <!-​- language: lang-none --> does not seem to work for block quote

After using <!-- language-all: lang-sql -->, this is formatted as SQL: SELECT * FROM foo LIMT 12345; Next, a block quote (to keep line breaks!), but language syntax is not desired. So I use &...
5
votes
1answer
217 views

Update code-prettify

There have been certain changes in code-prettify which it’d be nice to have used on Stack Overflow et al. The primary matter I care about is the Rust highlighter because the one currently used handles ...
1
vote
0answers
57 views

Syntax highlight for the Swift programming language [duplicate]

Recently Apple announced the Swift language to be open sourced later this year. I noticed that google prettifier, which is used in eg. stack overflow to post code snippets, is not yet been adapted ...
8
votes
1answer
78 views

Adding a language hint to a tag for syntax highlighting

I am a moderator over at Economics.SE, where some users have requested that syntax highlighting be implemented for questions that use the r, Matlab, or python programming languages. As I understand (...
1
vote
1answer
38 views

How can I associate specific tag with specific syntax highlighting

My understanding based on what I've read on meta is that syntax code highlighter applies specific syntax code highlighting if question is tagged with some corresponding tag. The thing is that it's ...
4
votes
1answer
81 views

Syntax coloring doesn't show on Cross Validated (stats) site [closed]

Syntax highlighting doesn't appear to work on Cross Validated. For instance, see the question PyMC for Categorical Latent Model which is set to use the Python language syntax via: <!-- language: ...
3
votes
1answer
80 views

How to turn off syntax highlighting in indented portion of block quote

I've edited this answer, adding text that I copied from a FAQ and then block quoted: > 3.1) How do I find the creation time of a file? > > You can't - it isn't stored anywhere. ...
9
votes
0answers
106 views

Replace lang-rust for prettify [closed]

Google doesn’t maintain code-prettify. Things like my patch for proper Rust support—https://github.com/google/code-prettify/pull/375—just get ignored. Could you guys take my lang-rust.js and use it ...