PrismJS / PrismJS/prism

JAVA comments have no color

Open
#3,848 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Information:

  • Prism version: 1.29.0
  • Plugins: <script src="//cdn.jsdelivr.net/npm/prismjs@1/plugins/autoloader/prism-autoloader.min.js"></script>
  • Environment: docsify latest

Description
I'm using prism 1.29.0 with docsify. My index.html is as follows:


<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <meta charset="UTF-8" />
  <link
    rel="stylesheet"
    href="//cdn.jsdelivr.net/npm/docsify@4/themes/vue.css"
  />

  <link href="//cdn.jsdelivr.net/npm/prismjs@1/themes/prism-dark.css" rel="stylesheet">
</head>
<body>
  <div id="app">Loading...</div>
  <script>
    window.$docsify = {
      name: 'Ieco-Common',
      coverpage: true,
      onlyCover: true,
      loadNavbar: true,
      mergeNavbar: true,
      maxLevel: 2,
      theme: 'dark',
      search: "auto"
    }
  </script>
  <!-- Docsify v4 -->
  <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
  <script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.js"></script>
  <!-- <script src="https://cdn.bootcss.com/docsify/4.5.9/plugins/search.min.js"></script> -->
  <script src="//cdn.jsdelivr.net/npm/prismjs@1/prism.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs@1/plugins/autoloader/prism-autoloader.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-xml-doc.js"></script>
  <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-java.js"></script>

  <script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-yaml.js"></script>
  <script src="//unpkg.com/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js"></script>
</body>
</html>

My code content in markdown format:

/**
* Business log interface modification example
* The difference between @BusinessLog and @AutoLog is that @BusinessLog will determine if the interface name contains the characters "modify", "edit", or "state switch", and will
* start the data comparison function to compare the modification points of the user's new and old data and record them in the database. Before modifying, you need to use the LogObjectHolder.me().set()
* method to save the database data entity before modification.
* @param json
* @return
* @throws Exception
*/
@BusinessLog(value = "Modify test interface", key = "departId")
@PostMapping("/businessLogDemo")
public BaseResult businessLogDemo(JSONObject json)throws Exception

But the actual effect is as follows:
image

I thought the comments would be olive green like Idea, or dark like git code highlighting.

But there is basically no color rendering of the code in the rendering.

Did I do something wrong?

Example
I wrote a simple example, you can check my git repository。
For specific environment and startup steps, please refer to readme.md in the repository
https://github.com/brucelpt/docsify-prism-demo.git

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report using the index.html configuration, the Java snippet, and the brucelpt/docsify-prism-demo repository. Start by checking the loaded Prism theme, Java grammar, and autoloader in that setup. Done means the cause of the missing comment color is confirmed and the supplied example renders as expected or clearly documents the configuration boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript
Domain
frontend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.