No syntax highlighting here?

It is only me, or the site is not highlighting the code now?

function test(x)
    return x + 1

These errors from the browser console is probably related:

13:13:57.974 Failed to load ‘’. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘Error: no-response :: [{"url":""}]’.
13:13:57.974 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS request did not succeed). Status code: (null).
13:13:57.974 Module source URI is not allowed in this document: “”. 106674:41:141

I’m not seeing any highlighting either.

It’s this.
Domain sends header strict-origin-when-cross-origin which blocks the loadìng of as it is a different domain.

It needs a second header Access-Control-Allow-Origin configured properly.

1 Like

Huh. Thanks for raising and identifying this; not sure how or why it regressed. I’ll look into it when I can.


This should now be fixed, thanks to the Discourse hosting team!

julia> struct T; end # works!

Out of curiosity, what sort of highlighting is there supposed to be? My desktop browser (Chrome) shows no highlighting of any kind, and never has. So I at first didn’t even understand what this thread was about.

My phone browser actually does show some very subtle highlighting, bold for keywords (I never noticed it before now, because it’s so subtle.) And then, the Julia prompt is actually green, which is the only highlighting I have noticed.

What am I missing? Can someone paste an image of highlighted code for me to see? Is it only for mobile?

This is what you should see on all platforms. It’s not just a mobile thing.

It’s not too dramatic, but keywords are bolded, some builtin types are blue, numbers are teal, strings are red, comments are italicized gray. Do you have any errors in your browser console?

Yes, I seem to have several. Of interest there is

Access to fetch at '' from origin '' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value '' that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Uncaught (in promise) no-response: no-response :: [{"url":""}]
    at u._handle (
    at async u.Rt (

That looks like you still have a stale cache — that’s the very problem we just fixed. Try clearing your caches and refreshing.

1 Like

I tried doing that just before you posted, and it works :smiley:

Oh well. It’s just that I never saw any highlighting, so I didn’t even understand what the discussion was about. “There’s supposed to be highlighting? :face_with_raised_eyebrow:

If anyone is interested in some CSS’ing, it’s all a matter of themeing. I’m always happy to take suggestions on this — see, e.g., Adding support for `julia-repl` syntax highlighting - #7 by g-gundam.

julia> if a<1.2 || b=="s" && c in Dict(:a=>'f'); 1::Int end

The highlights.js library puts these classes on the above:

<span class="hljs-meta prompt_">julia&gt;</span>
<span class="language-julia">
    <span class="hljs-keyword">if</span>
    <span class="hljs-number">1.2</span>
    || b==
    <span class="hljs-string">"s"</span>
    &amp;&amp; c 
    <span class="hljs-keyword">in</span>
    <span class="hljs-built_in">Dict</span>
    <span class="hljs-string">'f'</span>
    <span class="hljs-number">1</span>
    <span class="hljs-built_in">Int</span>
    <span class="hljs-keyword">end</span>

The HTML highlighting is much more colorful as its markup is so standard that it tags pretty much everything, including things that don’t make much sense in Julia’s syntax (e.g., tags, names, attrs, etc).

The highlighting colors are also a function of the color scheme
selected in your Discourse preferences. A dark scheme gave me
only monochrome highlights (bold, normal, grey, dark grey,…).
Changing to a light scheme made the prompt get a color.

1 Like

That’s a good point — and it’s also worth noting that while we ostensibly have five themes available for you to pick here, it’s mostly the default Light Theme and Dark Theme that have gotten the most care and attention.

1 Like

Thanks for this tip! I had my theme set to “graceful” and some, but not all the highlights. the julia> prompt didn’t show green, for example. I thought I was the odd one out here with weird highlighting. But switching back to light theme fixed it.