Skip to content

(javascript) regression: “for await“ highlighted as function instead of keyword #4235

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

Closed
wolfgang42 opened this issue Mar 31, 2025 · 1 comment · Fixed by #4240
Closed
Labels
bug help welcome Could use help from community language

Comments

@wolfgang42
Copy link
Contributor

Describe the issue
In the statement for await (foo) {}, the keyword await is being incorrectly highlighted as a function since 063876f (#3940).

Which language seems to have the issue?
JavaScript

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce

for await (foo) {}

Expected behavior
for await are both highlighted as keywords.

Additional context

I upgraded highlight.js and this stopped working. I bisected the problem to 063876f (#3940), but I don’t really understand the internals of highlight.js well enough to figure out why that code is being triggered in this position or what to do about it.

@wolfgang42 wolfgang42 added bug help welcome Could use help from community language labels Mar 31, 2025
@wolfgang42
Copy link
Contributor Author

(CC @cyfung1031 / @joshgoebel as author/committer of previous PR.)

wolfgang42 added a commit to wolfgang42/highlight.js that referenced this issue Apr 11, 2025
wolfgang42 added a commit to wolfgang42/highlight.js that referenced this issue Apr 11, 2025
joshgoebel pushed a commit to wolfgang42/highlight.js that referenced this issue Apr 23, 2025
ewwwin pushed a commit to ewwwin/highlight.js that referenced this issue Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant