-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: linebreak after @link can cause wrong parsing of subsequent doc #8511
Comments
…g of subsequent doc Allowing also a `\n` after the @link.
It appears to be common (e.g. in the Java standard library) to use
I simplified it as far as possible to pin the issue as precisely as possible. I guess the occurrence of
Neither would I. Unfortunately I observed it "in the wild". Probably due to long class names and maximum line width conventions. Thanks for fixing this so quickly! Will check it out... |
I see, the linebreak nukes the param-list no matter whether it starts with
Just looked it up and it confirms the explained use for type parameters:
|
Looks a bit like doxygen uses for this the This template issue is of course different from the original linebreak issue, so best is to create an new issue for this template issue. |
Code has been integrated in master on github (please don't close the issue as this will be done at the moment of an official release). |
So far, I am not really aware of a separate issue. I guess using I cannot really tell because I never used |
I think I was indeed thinking in the direction of C++ when mentioning the |
There are some subtle differences between Java generics and C++ templates (e.g. type erasure), but I think the overall concepts are similar enough to treat them equally in terms of documentation style. So, idealistically speaking I guess the right way would be to treat I am hesitating to file this as an issue because I don't really know how "this manner" actually looks like. Unless someone else is going to stand up and do this work, I will keep it in mind until I use doxygen with C++ code so I can naturally explore the behavior of |
I happened to notice that this issue is not entirely fixed. The effects of a linebreak in
Doxygen links the ref to
|
…g of subsequent doc In this case we have a linebreak in the argument list, this is, for JAVA, not unreasonable.
This is a bit a different situation as the original problem was about the fact that the return was between the I've just pushed a proposed patch, pull request #8573 @Stewori although a bit related issue has a different background and as the original issue was already merged it would have been better to create a new issue with, in this case, a reference to this issue) |
Describe the bug
Processing Java code
makes doxygen invent an
<s>
tag in xml output:This is triggered by the linebreak in
@link
. If one writes it as a one-liner* A linebreak in a link {@link A}
one gets the expected behavior described below.
Expected behavior
I expect the xml output to be the same as if the
@link
was written as a one-liner:To Reproduce
Find a Java file and doxygen config attached. The issue is demonstrated like mentioned above.
After running doxygen on the example, the files in the subfolder
xml
contain the snippets shown above.issue_param_s.zip
Version
Tested with doxygen clone from 2021-04-11:
lsb_release -a
:Additional context
This is not an academic issue, it actually occurs in Java standard library. More specifically it occurs in
java.util.ServiceLoader.load
which is part of thejava.base
module, which in turn is a dependency for every Java program. One use case to process the Java standard library with doxygen is to work around issue #8433. This also explains why it is not a simple solution to just manually rewrite the javadoc to avoid linebreaks after@link
.Edit: I admit it is not crucial to have all javadoc processed totally cleanly, just in order to work around #8433. Anyway, I happened to notice this issue during such a task.
The text was updated successfully, but these errors were encountered: