Skip to content

fix(javascript) incorrect function name highlighting #3940

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

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

cyfung1031
Copy link
Contributor

@cyfung1031 cyfung1031 commented Dec 13, 2023

@joshgoebel
Copy link
Member

Awesome, so now lets just add a changelog entry! :)

@cyfung1031 cyfung1031 changed the title fix: javascript function name highlighting bug fix(javascript): incorrect function name highlighting Dec 16, 2023
@cyfung1031 cyfung1031 changed the title fix(javascript): incorrect function name highlighting fix(javascript) incorrect function name highlighting Dec 16, 2023
@cyfung1031
Copy link
Contributor Author

Awesome, so now lets just add a changelog entry! :)

done.

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

7 files changed

Total change +63 B

View Changes
file base pr diff
es/core.min.js 8.17 KB 8.17 KB -1 B
es/highlight.min.js 8.17 KB 8.17 KB -1 B
es/languages/javascript.min.js 2.71 KB 2.73 KB +17 B
es/languages/typescript.min.js 3.14 KB 3.15 KB +16 B
highlight.min.js 8.21 KB 8.21 KB -1 B
languages/javascript.min.js 2.72 KB 2.74 KB +17 B
languages/typescript.min.js 3.14 KB 3.16 KB +16 B

@joshgoebel
Copy link
Member

Will have to take another look later, tests aren't all passing.

@cyfung1031
Copy link
Contributor Author

cyfung1031 commented Dec 17, 2023

Will have to take another look later, tests aren't all passing.

I am not quite sure what the error suggested.
Might it be due to the conflict with the latest commits?

btw, regex.lookahead(/\(/)) also works.
only

.map(x => `${x}\\s*\\(`))

is required.

Copy link

Build Size Report

Changes to minified artifacts in /build, after gzip compression.

7 files changed

Total change +71 B

View Changes
file base pr diff
es/core.min.js 8.17 KB 8.17 KB +2 B
es/highlight.min.js 8.17 KB 8.17 KB +2 B
es/languages/javascript.min.js 2.71 KB 2.73 KB +17 B
es/languages/typescript.min.js 3.14 KB 3.15 KB +16 B
highlight.min.js 8.21 KB 8.21 KB +1 B
languages/javascript.min.js 2.72 KB 2.74 KB +17 B
languages/typescript.min.js 3.14 KB 3.16 KB +16 B

@joshgoebel joshgoebel merged commit 063876f into highlightjs:main Dec 19, 2023
aral pushed a commit to aral/highlight.js that referenced this pull request Mar 25, 2024
* fix(javascript) incorrect function name highlighting
wolfgang42 added a commit to wolfgang42/highlight.js that referenced this pull request Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(JavaScript) Function names with a prefix shared with a built-in global are confused for a global
2 participants