highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.31k stars 3.52k forks source link

Inconsistent highlighting of numbers #4011

Closed ndattani closed 3 months ago

ndattani commented 3 months ago

Describe the issue/behavior that seems buggy:

Notice that the number 035 is black but all other numbers in that column are orange:

image

See this: https://mattermodeling.stackexchange.com/a/12545/5

Sample Code or Instructions to Reproduce:

aug-cc-pV6Z:    -0.499999 276396 663  (PySCF, 127 functions), default settings
aug-cc-pV7Z:    -0.499999 752574 58   (PySCF, 189 functions), default settings
aug-cc-pV8Z:    -0.499999 966893 035  (PySCF, 268 functions), default settings
aug-cc-pV9Z:    -0.499999 977357 467  (PySCF, 367 functions), default settings
aug-cc-pV10Z:   -0.499999 980721 463  (PySCF, 485 functions), default settings
joshgoebel commented 3 months ago

Numbers don't start with a 0 in whatever language grammar you are using here. Please provide additional detail on the language if you believe a prefix 0 number is valid in whichever language this is supposed to be.

ndattani commented 3 months ago

@joshgoebel Apparently the language is "automatically detected". Based on the text that I provided, are you able to determined which language this is?

joshgoebel commented 3 months ago

You could use the web inspector on SE - the HTML generated might tell you. Otherwise, no idea.

But as this is not a problem with Highlight.js - it's not intended to highlight random text SE - I'm closing this issue.