highlightjs/highlight.js

(C++) highlight incorrectly

Open

#3,505 opened on Mar 21, 2022

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (3,497 forks)batch import
buggood first issuehelp welcomelanguage

Repository metrics

Stars
 (22,960 stars)
PR merge metrics
 (Avg merge 6m) (2 merged PRs in 30d)

Description

Describe the issue

Screenshot_20220320_225211

Everything after the define line has no highlighting.

Which language seems to have the issue?

C++

Are you using highlight or highlightAuto?

highlight.js 11.5.0

Sample Code to Reproduce

int a = 1;

#define what do { cout << ">"; } while (0)

int main() {
}

Expected behavior

Highlight correctly after the define line.

Contributor guide