highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

(java) Highlighting fails on square brackets ([]) of array type

Open Elewyth opened this issue 2 years ago • 0 comments

Describe the issue When the return type of a method is an array type, the function name is not highlighted.

Which language seems to have the issue? Java

Are you using highlight or highlightAuto? hightlightAll() with class="language-java" on the <code>-block

Sample Code to Reproduce

<pre><code class="language-java">
interface FooBar {
  String foo();
  String[] bar1();
  String&#91;&#93; bar2();
}
</code></pre>

http://jsfiddle.net/Elewyth/Lxmgwosk/

Expected behavior foo, bar1, and bar2 should all be highlighted as a function name.

Additional context Tested with 11.7.0.

Elewyth avatar Dec 12 '22 16:12 Elewyth