Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc: line breaks without HTML-tags?

Sorry for a probable FAQ kind of question, but I just can't find the answer.

As far as I remember Eclipse, a blank line in a Javadoc comment is displayed (in in-source Javadoc popups) as a line break (with extra vertical spacing).

In Netbeans, however, this is not the case.

Can I configure Javadoc to interpret a blank line as a line break?

Additional question: Can I override default Netbeans behavior (related to this) for in-source Javadoc popups?

What I'm talking about is:

Source

/**  * Paragraph One  *  * Paragraph Two  */  void someMethod() { } 

Eclipse interpretation

 Paragraph One   Paragraph Two 

Netbeans interpretation

 Paragraph One Paragraph Two 
like image 640
java.is.for.desktop Avatar asked Feb 22 '11 11:02

java.is.for.desktop


People also ask

Does Javadoc use HTML?

There are no real restrictions on the use of HTML in Javadoc comments. The Javadoc documentation states: Comments are written in HTML - The text must be written in HTML, in that they should use HTML entities and can use HTML tags.

How do you break a line in HTML?

The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant.

How do I escape from Javadoc?

If you want to start a line with the @ character and not have it be interpreted, use the HTML entity @. This implies that you can use HTML entities for any character that you would need to escape, and indeed you can: The text must be written in HTML with HTML entities and HTML tags.


1 Answers

It has nothing to do with Netbeans. I suspect you are looking at the source code in one case and the output of Javadoc in the other case. Newlines are not significant in HTML: ergo the output will not show them. If you want a newline use a <p> or a <br>.

like image 186
user207421 Avatar answered Oct 21 '22 04:10

user207421