GNOME Bugzilla – Bug 665313
Whitespace in front of "@if" removed differently in 1.7.x than 1.6.x
Last modified: 2012-11-18 11:11:20 UTC
I have a lot of documentation done using 1.6.3. In attempting to upgrade to 1.7.x, I discovered that both 1.7.3 and 1.7.5 handle whitespace around conditional @if statements and @endif statements differently. The difference can be illustrated by writing text like the following: some text in front @if clike middle@endif tail text 1.7.5 eats the space before @if and after @endif, mangling the output and producing the following in the formatted output: some text in frontmiddletail text Among the consequences is that if "middle" contained a reference to an object like a class name, the result won't be hyperlinked (because it's mangled and Doxygen itself fails to recognize it). Here is an example of where it causes problems. Suppose your code has this comment: /** * Blah blah blah. * * Use the method @if java Compartment::setId(String id)@else setId()@endif. */ The result in the formatted output will be: Blah blah blah. Use the methodsetId(). Doxygen 1.6.3 does not behave this way, and leaves the spaces in the final output. I cannot find this change listed in the ChangeLog. I also don't know how to work around this behavior. If I'm missing something obvious, or an explanation or a workaround, I apologize, and would appreciate it if someone could explain it to me. Thanks. BTW, Doxygen has been just a fantastic tool for us. We use it to produce the documentation for our open-source library, libSBML.
This change was made to fix bug #620924. For inline @if..@endif constructs like in your example this doesn't work. I'll come up with a better solution in the next release.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.6.1. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant.
Hi, Thanks for such a prompt response to this. I've switched to using 1.7.6.1, and have tested this situation, and it looks like one half of the problem is indeed solved: it doesn't eat the space in front of @if. However, it's still eating the space after @endif. I used the following input file to test it: * a @if cpp b @else c @endif d * * a @if cpp b@else c @endif d * * a@if cpp b @else c @endif d * * a @if cpp b @else c@endif d * * a @if notcpp b @else c @endif d * * a @if notcpp b@else c @endif d * * a@if notcpp b @else c @endif d * * a @if notcpp b @else c@endif d Then I ran Doxygen with ENABLED_SECTIONS containing "cpp". The result in the formatted output was: a bd a bd abd a bd a cd a cd acd a cd From this, it appears that the whitespace after @endif is being removed. This is still a bit problematic when the construct is used inside a paragraph. Thank you very much for your help so far! Best regards, MH