Skip to content

(java) Highlighting breaks on Generics with fully-qualified-name #3677

Description

@Elewyth

Describe the issue
When the type inside of a generic (i.e. inside of <>) includes . as part of a fully qualified class name, the highlighter no longer seems to parse the rest of the line.

Which language seems to have the issue?
Java

Are you using highlight or highlightAuto?
hljs.highlightAll() with class="language-java" on the <code>-element
...

Sample Code to Reproduce

<pre><code class="language-java">
interface FooBar {
  List&lt;String&gt; foo();
  List&lt;java.lang.String&gt; bar();
}
</code></pre>

http://jsfiddle.net/zwg2sp4x/

Only "foo" is highlighted as a function name, "bar" is not.

Expected behavior
both "foo" and "bar" should be highlighted as a function name.

Additional context
Tested with versions 11.7.0 and 10.5.0 with same behavior on each

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions