highlightjs/highlight.js

(C#) Support digit separators

Fermée

#4 258 ouverte le 9 mai 2025

 (2 commentaires) (0 réaction) (0 personne assignée)JavaScript (3 497 forks)batch import
buggood first issuehelp welcomelanguage

Métriques du dépôt

Stars
 (22 960 étoiles)
Métriques de merge PR
 (Merge moyen 6m) (2 PRs mergées en 30 j)

Description

Describe the issue Digit separators are not supported: if you write 20_000_000 for example, 20 will be number-colored, while _000_000 will be treated as invalid.

Which language seems to have the issue? C#

Are you using highlight or highlightAuto? highlight

Sample Code to Reproduce

int i = 20_000_000;

Screenshot of broken syntax highlighting

Expected behavior the entirety of the number to be highlighted as a number, like on GitHub: Screenshot of correct syntax highlighting

Additional context None

Guide contributeur