highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.6k stars 3.58k forks source link

fix(javascript) incorrect function name highlighting #3940

Closed cyfung1031 closed 9 months ago

cyfung1031 commented 9 months ago

Before

Screen Shot 2023-12-13 at 20 46 11

After

Screen Shot 2023-12-13 at 20 46 08

cc @joshgoebel @arnog

joshgoebel commented 9 months ago

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

cyfung1031 commented 9 months ago

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

done.

github-actions[bot] commented 9 months ago

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 commented 9 months ago

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

cyfung1031 commented 9 months ago

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.

github-actions[bot] commented 9 months ago

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 |