182 votes

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

Can Stack Exchange please update to newer versions of Highlight.js on a regular cycle, rather than only on request? As I said in my prior post reporting Google's discontinuation of Prettify, the ...
Sonic the Anonymous Hedgehog's user avatar
117 votes

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

I found it rather frustrating that I couldn't easily see how the before/after pictures differed, so I did a bit of cutting and pasting so I could look at the before/after side by side to compare them ...
Jerry Coffin's user avatar
  • 2,936
59 votes

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

I'd like to say that I appreciate this post. It is clear, very informative, very detailled, and to me shows that person's concern for the community. Of course, there will always be different opinion ...
Olivier Dulac's user avatar
57 votes

How do I escape a backtick ` within in-line code in Markdown?

For fenced code blocks, the prescription is more backticks. This Markdown ```` ``` Example of Markdown syntax for fenced code block with triple back ticks ``` ```` will be rendered like this ``` ...
Christian Long's user avatar
48 votes

Request for a possibility to adjust the spacing between lines

I couldn't agree more with this proposal! I'm all for making the site more accessible - but it should be about making it more accessible for all. There's a fair bit of research showing that increased ...
motosubatsu's user avatar
  • 4,309
30 votes

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

Current maintainer of Highlight.js here, though I'd add a few quick comments. highlight.js tends to not highlight punctuation, which makes it a bit less colorful than other highlighters. This is ...
Josh Goebel's user avatar
  • 1,609
28 votes

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

bug status-bydesign <!-- language-all: lang-none --> hint doesn't seem to work anymore This post has a <!-- language-all: lang-none --> hint at the top of the post to prevent all the code ...
Sonic the Anonymous Hedgehog's user avatar
27 votes

Inline Code Spans should not be used for emphasis, right?

From the comment by @SevenSidedDie, which deserves to be in its own answer, rather than buried in a comment under a heavily downvoted answer: [Using backticks is] not just distracting, it's ...
22 votes

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

C is not supported There is no C syntax highlighter in highlight.js. highlight.js uses the C++ highlighter for C, and it is a nightmare. It actually makes code harder to read than not having any ...
Antti Haapala's user avatar
20 votes

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

😄 Thanks for doing this! I'm happy about this outcome, as I was a major proponent of switching to highlight.js back in 2016. Great! …but what changed? To satisfy my own curiosity, I'm wondering if ...
jtbandes's user avatar
  • 5,473
18 votes

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

What to do if highlight.js supports a language but Stack Exchange doesn't? There's an entire Mathematica StackExchange, and so Mathematica syntax highlight is clearly very important to us. But when I ...
b3m2a1's user avatar
  • 350
18 votes

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

status-bydesign Will the default code markdown be changed to code fences? Currently if you click the code ({}) icon in the editor, then the selected text is still indented (or unindented) by 4 white ...
Larnu's user avatar
  • 1,009
17 votes

How do I escape a backtick ` within in-line code in Markdown?

Use <code> and HTML character entities instead. This is especially useful in situations where your code is already wrapping things in backticks (e.g., in Swift, enum { case `true` = ...
Slipp D. Thompson's user avatar
16 votes
Accepted

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

The list is maintained in the official FAQ: What is syntax highlighting and how does it work? Do note that makefile is not in this list. The reason you see some effect is caused by the fallback that ...
rene's user avatar
  • 89.2k
16 votes

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

Apparently asm / assembly has never(?) been supported as a syntax-highlighting language, and the somewhat decent highlighting we got in the past was from auto-detection (presumably as some other ...
Peter Cordes's user avatar
16 votes
Accepted

I need help and the site is not letting me post my code. Says “Your post appears to contain code that is not properly formatted as code.”

Your question is broad, asking for resources and it is unclear what does work and what doesn't work. I've done some editing of your raw text to get it into some shape but I find it difficult to ...
rene's user avatar
  • 89.2k
15 votes

False positive? I get this error but cannot find any reason: "Your post appears to contain code that is not properly formatted as code."

So, here's how I debug these: Get the error to appear. This is easy for me, since we log the full text for each error. It's even easier for you, since you already have the editor open with the error ...
Shog9's user avatar
  • 450k
14 votes

Cannot dismiss scrollbar in code box, blocks view

Paraphrasing myself: If you’re ok with changing things everywhere, the behavior of scroll bars can be changed in System Preferences. (Look in General or search for scroll bar behavior.) Set it to “...
Laurel's user avatar
  • 53.5k
13 votes

Why can't the title be formatted?

The title of a question should describe the question - a short descriptive text. Adding markup and code capabilities to it would just make things messy and some people would abuse these features. It ...
Oded's user avatar
  • 155k
13 votes

How to "prettify" my coments

Don't post code as comments in the first place. Edit it into your question or answer instead. The purpose of comments is for requests for clarification. If you don't use them as intended then as you'...
Robert Longson's user avatar
13 votes
Accepted

Revisions list Code Block stretches screen

This is fixed. When working on review queues, I switched from using fixed width tables to flexbox for rendering the side-by-side HTML diff, and apparently <table> elements are just as stubborn ...
Brian Nickel's user avatar
  • 34.1k
12 votes

How do I escape a backtick ` within in-line code in Markdown?

It's different in posts and in comments. For posts 1. `` ` `` Result (only for posts, not valid in comments): ` 2. <code>\`</code> Result (only for posts, not valid in comments): ` ...
Flux's user avatar
  • 749
12 votes
Accepted

Avoiding the character # to signal comment

This is a failure of the Stack Exchange syntax highlighting. Because you haven't specified, it seems to be falling back on the default highlighting, which tries to be pretty general to any programming ...
Billy Mailman's user avatar
12 votes

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

I've just tried the following piece of JavaScript code (from this answer of mine in Code Golf) because Google Prettify was not parsing the regular expression followed by an inline comment correctly. ...
Arnauld's user avatar
  • 320
12 votes

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

In LaTeX code, @ should be treated as a letter. There are any number of examples on tex.stackexchange, but Undefined control sequence on \beamer@leftmargin indentation \begin{frame}[fragile]{E} \...
David Carlisle's user avatar
11 votes

How to type italics or bold inside code in a comment

You're almost there, you just have to reverse the order of the formatting: **`bold`** produces bold *`italic`* produces italic As you can see, this works in posts as well.
Glorfindel's user avatar
  • 251k
11 votes
Accepted

Chat removes ´ when trying to type code to someone

The ` are used to indicate inline code, just like in posts or in comments. Typing `name` results in name, this is status-bydesign. If you want these backticks to be displayed instead, escape them ...
Glorfindel's user avatar
  • 251k
11 votes

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

There has been times that I've turned off code highlighting with <!-- language: lang-none --> because Prettify was getting it wrong, and no highlighting is better than wrong highlighting. (The ...
TRiG's user avatar
  • 7,403
11 votes

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

This is a hard problem for us due to many years of tech debt and how most users expect the site to act. We have a few potential options here: Support every language hljs supports. This is the ideal ...
Adam Lear's user avatar
  • 159k
11 votes

How can I find posts with particularly large code blocks in a non-code-based site?

Here is a simple query which shows the length of the first code block (in characters). It works fine on a site like Space Stack Exchange, I'm not sure about larger sites. I have no doubt @rene can ...
Glorfindel's user avatar
  • 251k

Only top scored, non community-wiki answers of a minimum length are eligible