GNOME Bugzilla – Bug 678436
Nested \if messes up list items
Last modified: 2014-04-21 10:09:34 UTC
The main bug here is a regression that started in version 1.7.0 and is present through at least 1.8.1. A nested \if in the middle of a list messes up the subsequent entry. To reproduce, in my Doxyfile I have: ENABLED_SECTIONS = ENABLED_SECTION ENABLED_SECTION2 The html generated from this comment incorrectly has "Outer Item 3" indented: /** \mainpage Main Page - Outer Item 1 \if DISABLED_SECTION \if ENABLED_SECTION - Outer Item 2 \endif \endif - Outer Item 3 - Outer Item 4 */ The bug only occurs with a nested \if where the outer is disabled. The inner \if can be either enabled or disabled. There is a second weird behavior that seems related but it may be a separate bug. Here, "Outer Item 2b" is displayed when it should not be shown at all. With version 1.7.5, "Outer Item 2b" is indented. With version 1.6.3 it is not indented (and it has blank lines around it but that's a separate bug 620924) but it is still incorrectly displayed. /** \mainpage Main Page - Outer Item 1 \if DISABLED_SECTION \if DISABLED_SECTION - Outer Item 2 \endif - Outer Item 2b \endif - Outer Item 3 - Outer Item 4 */ The only workaround I can find, short of not using doxygen 1.7.0+, is to add a blank line. This eliminates the incorrect indent but adds an ugly blank line to the html output: /** \mainpage Main Page - Outer Item 1 \if DISABLED_SECTION \if ENABLED_SECTION - Outer Item 2 \endif \endif - Outer Item 3 - Outer Item 4 */ Finally, there is a third problem with lists that shows up when there is a disabled nested \if section followed by two enabled nested \if sections: /** \mainpage Main Page \if DISABLED_SECTION \if ENABLED_SECTION2 - Outer Item 1 \endif \endif \if ENABLED_SECTION \if ENABLED_SECTION2 - Outer Item 2 \endif \endif \if ENABLED_SECTION \if ENABLED_SECTION2 - Outer Item 3 \endif \endif */ doxygen produces this warning: "Invalid list item found". The line number it gives is 3, which doesn't make sense: is it removing the \if lines before calculating that? The warning itself certainly seems incorrect. The generated html lists "Outer Item 3" as a non-list non-indented line, rather than the list item it should be.
Changed version 'latest' to '1.8.2-SVN' so I can remove 'latest' as an option as it is a moving target.
I've just submitted a solution (solving all 3 problems) to github (pull request 150)
*** Bug 696276 has been marked as a duplicate of this bug. ***
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.7. 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 (preferrably in the form of a self-contained example).