Investigate why GLSL syntax highlighting does not work

Here is a sample snippet:

uniform float time;

void fragment() {
	ALBEDO = vec3(time);
}

For some reason using ```glsl as a hint does not lead to proper syntax highlighting. The used library highligh.js should support it out of the box, so we will need to investigate why it does not work.

(for context, GLSL is useful as it also works for godot shading language)

1 Like

I can’t easily tell from this side, but you need to call registerLanguage(‘glsl’, something) right? Is that a thing you’re doing.

I don’t think you need to call that for built-in languages. It’s only needed for plugin languages like we do for GDScript

The example on the web calls it for javascript. That makes me think it defaults to not load anything at all.

hmm, at least in discourse typescript works out of the box:

const foo = "bar"

So if it is required, then that is already done by discourse. But I’ll see how discourse does this internally, maybe that’s a good start to investigate.

Ok turns out I just missed this setting :sweat_smile:

So, the good news: GLSL works now! :tada:
The bad news: The color scheme is awful (just white and some keywords bold)…

uniform float time;

void fragment() {
	ALBEDO = vec3(time);
}

So I guess this issue is fixed, but we really need to do this soon: Use better color scheme for syntax highlighting

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.