GCODE highlighting is not included by default

Hi,

Trouble

.gcode highlighting is confused, even though gcode is a supported language in highlight.js.

A simple test

auto language selection (maybe some sort of C? )

M117 Heating Up ; write heating up
M190 S30 ; heat up the bed to 30°C and hold

ruby specified (yay. this is to show that forced language selection does something)

M117 Heating Up ; write heating up
M190 S30 ; heat up the bed to 30°C and hold

gcode specified (nay, it looks like the auto-select, and it ain’t right.)

M117 Heating Up ; write heating up
M190 S30 ; heat up the bed to 30°C and hold

thus

Is there some test I can do to see whether this is on Discourse side or Highlight.js side?
(And then, what would that mean…)

highlight.js supports a very large number of languages. It would result in very poor performance if we supported all languages by default. gcode is not a default language supported, so it will not work here on Meta. You can add support for gcode on your site by adding it to the highlighted languages site setting.

For reference, here are the languages supported on Meta:

image

6 Likes

Thanks for a swift reply.

After I enabled gcode, the highlighting is still funky/ funky in a completely new way, but now it looks like highlight.js issue. I guess the gcode support is just… not working. Still better than before! just can’t handle gcode comments it seems.

Thanks!

1 Like

That you’d need to take up with highlight.js. Glad you got it working!

2 Likes

This topic was automatically closed after 46 hours. New replies are no longer allowed.