Skip to content
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

JAVA code is not highlighted #4720

Closed
stockiNail opened this issue May 3, 2021 · 11 comments
Closed

JAVA code is not highlighted #4720

stockiNail opened this issue May 3, 2021 · 11 comments
Labels
closed: working as intended This issue is intended behavior, there's no need to take any action.

Comments

@stockiNail
Copy link

🐛 Bug Report

The JAVA code is highlighted.

Have you read the Contributing Guidelines on issues?

YES

To Reproduce

https://codesandbox.io/s/blissful-colden-z454y?file=/docs/intro.md

  1. Step 1Open sidebar
  2. Step 2 Click tutorial
  3. Step 3 Go to the bottom, where JAVA code has been added.

Expected behavior

The JAVA code should be highlighted.

Actual Behavior

The JAVA code should be highlighted.

Source code:

DCbug1-src

Result:

DCbug1-run

Your Environment

@stockiNail stockiNail added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels May 3, 2021
@slorber
Copy link
Collaborator

slorber commented May 3, 2021

Agree something is weird, as Java is normally supported out of the box

We even have a Java snipped in ur website:
https://docusaurus.io/docs/next/markdown-features/code-blocks#multi-language-support-code-blocks

image

Is this a new bug after upgrading to alpha 75? Was it working before?

@stockiNail
Copy link
Author

@slorber I was using alpha-68 and it worked!

@stockiNail
Copy link
Author

We even have a Java snipped in ur website:
https://docusaurus.io/docs/next/markdown-features/code-blocks#multi-language-support-code-blocks

yes, sounds working on the official doc, but not in code sandbox (and in my project).. :(

@slorber
Copy link
Collaborator

slorber commented May 3, 2021

Can you try alpha 74? Alpha 75 is a big upgrade (Webpack 5) so it is more likely to have a few issues

@stockiNail
Copy link
Author

npm i @docusaurus/[email protected] @docusaurus/[email protected]

Nothing is changed. Furthercode, in sandbox, the Docusaurus version is alpha.73

@stockiNail
Copy link
Author

I have created new sample project, by npx @docusaurus/[email protected] init my-website classic and added the java code.

Same error, JAVA code is not highlighted.

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented May 4, 2021

There's the same issue here #4535

According to the docusaurus doc,

By default, Docusaurus comes with this subset of commonly used languages.

Which doesn't include Java, PHP, or Ruby. You have to manually include them in the config.

@stockiNail
Copy link
Author

stockiNail commented May 4, 2021

@Josh-Cena GREAT!!! Thank you! I don't know why I was convinced to see the code highlighting in version alpha.68...

@Josh-Cena
Copy link
Collaborator

Yeah, don't know when they stopped supporting Java—probably when they started using Prism? I also remember using Java back in ~alpha.68

@slorber
Copy link
Collaborator

slorber commented May 4, 2021

This is still weird for me: the Docusaurus site itself does not add any additional config and is able to highlight that Java code block here:

https://docusaurus.io/docs/next/markdown-features/code-blocks#multi-language-support-code-blocks

But nevermind, indeed Java should be added to the list of additional languages as it's not in the default enabled languages of react-prism-renderer

@stockiNail
Copy link
Author

I agree, it's very weird...

@Josh-Cena Josh-Cena added closed: working as intended This issue is intended behavior, there's no need to take any action. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: working as intended This issue is intended behavior, there's no need to take any action.
Projects
None yet
Development

No branches or pull requests

3 participants