Numbers with underscores for readability don't match normal code block numbers

Hello!

I’m not really sure how to be more concise, but when you have a code block with a number that has underscores for readability, it escapes the number formatting if that makes sense,

4_000_000

The whole number should be blue.

I only noticed it today.

1 Like

This doesn’t seem like a bug

4x
4ksidfi
4&:8;8384

0x24 -- valid hexadecimal, highlights correctly

I believe the ability to use an underscore to delimit thousands is exclusive to Luau (someone correct if wrong), and Discourse syntax highlighting is sourced from highlight.js, which doesn’t support Luau.

1 Like

Oh yeah you might be right, but I think escaped forms were an issue before though too, weren’t they?

Ex.

'\''

I know escaped forms aren’t native to Luau so maybe it was patched by highlight.js devs.

Not a bug, highlight.js doesn’t support Luau syntax.

Feature request here: Give us better syntax highlighting

1 Like