Skip to content

Javadoc text between < and > is hidden even when escaped; HTML entities in {@literal} tags still escapedΒ #1838

@tylertian123

Description

@tylertian123

I've noticed two issues related to HTML entities in Javadoc:

  1. Text between <> do not show up in the hover popup, even when escaped, e.g. &lt;foo&gt;
  2. HTML entities in {@literal} tags are still escaped (and as an effect {@literal <text>} and {@literal &lt;text&gt;} don't show up either)

Both of these behaviours are inconsistent with the output of the official Javadoc tool.

Environment
  • Operating System: Ubuntu 20.04.2 LTS
  • JDK version: 11.0.10
  • Visual Studio Code version: 1.55.0-insider
  • Java extension version: v0.76.0
Steps To Reproduce
  1. Create a new Java source file
  2. Paste in the following code:
public class Foo {
    /**
     * &lt;foo&gt;
     * {@literal <bar>}
     * {@literal &lt;bar&gt;}
     * {@literal &lt;}
     * baz
     */
    public void bar() {
    }
}
  1. Hover on the name of bar(), and only < baz will show up
Current Result

image

The first three lines are completely gone. The fourth line is displayed as <, even though it is inside a literal block and thus should remain as &lt;.

Expected Result

Output of Javadoc tool for comparison:
image

The first line should be shown as <foo>, and all following lines in {@literal} tags should be shown as-is, without converting HTML entities.

Additional Informations

I didn't make a project for this since it's reproducible with just a single file, but it should also be the same in a project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions