-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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 syntax highlighting doesn't work #4845
Comments
You'll need to manually setup Java syntax highlighting. Quote from the Docusaurus docs (emphasis mine):
Read https://docusaurus.io/docs/markdown-features/code-blocks#syntax-highlighting to learn how to setup syntax highlighting. 😉 |
@HonkingGoose thank you but I have already done it (I have created another issue about that some days ago #4720).
I have published here some days ago based on alpha.74 and works: Now, after the upgrade to beta.0, this is the result: |
Whoops, I did not see that you opened that prior issue, sorry! 😄 |
Created also a sandbox where https://codesandbox.io/s/eloquent-yonath-7spwh?file=/docs/intro.md EDIT: removing |
Is the highlight only broken when using the |
This is actually because the GitHub theme changed in However you can again return to previous syntax highlighting -- for this in prism: require.resolve('./src/github.js') |
@Josh-Cena @lex111 THANK YOUU! Let me test it and then I'm gonna close the issue. |
Interesting because the Docusaurus site is also broken 😅 We may need to fix that |
yes, for this reason I thought it was an issue. |
Does not work. |
Forgot to mention that you need to use the CommonJS format, so just copy-paste this gist to make things work. |
@lex111 I tested with last gist you gave me and it WORKS!!! Thank you! Only 1 thing, to correct your post. The config (beta.0) is the following (assuming to store github theme in prism: {
additionalLanguages: ['java'],
theme: require('./src/github.js'),
}, |
You only need to add |
🐛 Bug Report
(A clear and concise description of what the bug is)
Have you read the Contributing Guidelines on issues?
YES
To Reproduce
To see that is not working, you can go to Docusaurus site (beta.0 or 1):
Expected behavior
The expected behavior is to have the syntax highlighting on java source code.
I have the same problem in my project. When I was in version alpha.74, it worked, now on beta.0 doesn't work.
The bad thing is falling back to alpha.74, it doesn't work anymore....
Actual Behavior
Your Environment
Environment name and version: FF 88.0.1, Node.js v12.18.3
The text was updated successfully, but these errors were encountered: