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

(JAVA) Does not highlight the reserved keyword goto #3962

Closed alvinsjoy closed 8 months ago

alvinsjoy commented 8 months ago

Describe the issue The goto keyword is actually reserved in Java but it's not used and has no functionality. Highlight.js does not highlight the reserved keyword goto. Image below shows the demo page of the highlight.js website. image You can see that goto is not highlighted. Whereas the image below shows how goto is highlighted in the Visual Studio Code editor. image

Which language seems to have the issue?

Java

Are you using highlight or highlightAuto?

highlight

Sample Code to Reproduce

As goto is actually a useless keyword, you can just type in goto after selecting the language as Java.

Expected behavior

As you can see the screenshot of Visual Studio Code editor above, the goto function must be highlighted. Additional context

joshgoebel commented 8 months ago

Seems simple enough. We'd love a PR for this.