Skip to content
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

Nested \if messes up list items (Origin: bugzilla #678436) #4762

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Copy link
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.2-SVN on platform Other
Assigned to: Dimitri van Heesch

On 2012-06-20 02:55:40 +0000, Derek Bruening wrote:

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.

On 2012-11-18 11:08:06 +0000, Dimitri van Heesch wrote:

Changed version 'latest' to '1.8.2-SVN' so I can remove 'latest' as an option as it is a moving target.

On 2014-04-06 18:49:59 +0000, albert wrote:

I've just submitted a solution (solving all 3 problems) to github (pull request 150)

On 2014-04-19 16:59:51 +0000, Dimitri van Heesch wrote:

*** Bug 696276 has been marked as a duplicate of this bug. ***

On 2014-04-21 10:09:34 +0000, Dimitri van Heesch wrote:

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).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.