Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(C/C++) Hex float literal hilit #4065

Closed
sprintersb opened this issue Jun 11, 2024 · 1 comment · Fixed by #4094
Closed

(C/C++) Hex float literal hilit #4065

sprintersb opened this issue Jun 11, 2024 · 1 comment · Fixed by #4094
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language

Comments

@sprintersb
Copy link

Describe the issue

The rendering of a hexadecimal floating-point constant may stop in the middle of the literal

double a = -0x1.638e38e38e38ep5;

Live example: https://stackoverflow.com/q/78603151/1556746

Such literals are supported since C++17 / C99.

Which language seems to have the issue?

C/C++ (in stackoverflow what's renderd for the cpp "language").

Are you using highlight or highlightAuto?

Dunno. Using stackoverflow, and they said at Meta that I should report it here at highlight.js
...

Sample Code to Reproduce

double a = -0x1.638e38e38e38ep5;

though the artifact looks different here than on stackoverflow.

Expected behavior

A literal should either be highlightet completey, or not at all.

Additional context

Popped up in the context of stackoverflow

@sprintersb sprintersb added bug help welcome Could use help from community language labels Jun 11, 2024
@joshgoebel joshgoebel added the good first issue Should be easier for first time contributors label Jun 11, 2024
@Dxuian
Copy link
Contributor

Dxuian commented Aug 18, 2024

i reproduced the error only in c and couldnt reproduce it in cpp
so ive managed to come up with a fix for the problem in c and im going for a pr
(first os commit please be nice 😀)
first image is before 2nd is after
before
after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Should be easier for first time contributors help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants