After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678436 - Nested \if messes up list items
Nested \if messes up list items
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.2-SVN
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
: 696276 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-20 02:55 UTC by Derek Bruening
Modified: 2014-04-21 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Derek Bruening 2012-06-20 02:55:40 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.
Comment 1 Dimitri van Heesch 2012-11-18 11:08:06 UTC
Changed version 'latest' to '1.8.2-SVN' so I can remove 'latest' as an option as it is a moving target.
Comment 2 albert 2014-04-06 18:49:59 UTC
I've just submitted a solution (solving all 3 problems) to github (pull request 150)
Comment 3 Dimitri van Heesch 2014-04-19 16:59:51 UTC
*** Bug 696276 has been marked as a duplicate of this bug. ***
Comment 4 Dimitri van Heesch 2014-04-21 10:09:34 UTC
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).