-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Milestone
Description
From #17887 (comment)
Context
Currently, the website uses JavaScript to provide syntax highlighting. This is done via the code-prettify library. The highlighting is provided on runtime (when you open the page in the browser.
The prettifier comes from the Apache Maven Fludio Skin plugin that we use. You can see it in the plugin's GitHub repository here - src/main/resources/js/prettify.js
Problem
The prettifier is executed twice:
- Once in the Maven Fluido Skin
src/main/resources/fluido.jsscript - And then again by this line in
checkstyle.js
prettyPrint();
Proof that the execution happens twice
You can actually see that on the website (for example at https://checkstyle.org/writingjavadocchecks.html). If you inspect one of the code blocks, you will see that for each token, there is a <span> within a <span>:
<code class="language-java">
<span class="pln">
<span class="pln">
java
</span>
</span>
...
</code>But if we remove prettyPrint(); from checkstyle.js, then we get:
<code class="language-java">
<span class="pln">java</span>
...
</code>