Why is Eclipse code formatting broken </a> in the Javadoc @see tag?

I am using Eclipse 3.4 and have configured the Java code formatter with all the options in the Comments tab. The problem is that when I format a comment on a document that contains:

* @see <a href="test.html">test</a> 

the code formatter inserts a space into the final HTML, breaking it:

 * @see <a href="test.html">test< /a> 

Why? How to stop this?

This was not fixed by disabling any of the options on the Comments tab, for example, "Format HTML tags." The only thing I found was to completely disable Javadoc formatting by disabling both the formatting of the Enable Javadoc comments and the Enable block comment formatting options, which means that I need to manually format the comment blocks.

+4
source share
3 answers

I can only assume that this is a bug in Eclipse. This only happens with @see tags, this happens for all 3 built-in code formatting settings.

There are some interesting errors that have already been discovered in the neighborhood, but I could not find this particular one. See For example, @see search in Eclipse Bugzilla .

+4
source

Strict XML specifications require that self-closing tags must have a space before the closing slash:

 <gcServer enabled="true" /> <!-- note the space just after "true" --> 

I can only assume, as Bart said, that there is a fix in Eclipse that considers the closing tag to be actually a self-closing tag. Another idea: can you verify that your a tags are balanced (i.e. closed tags are not listed in the document)?

+1
source

This may be a bug in Eclipse 3.4. I use 3.3 (M20080221-1800) and do not observe this behavior.

+1
source

Source: https://habr.com/ru/post/1276553/


All Articles