Edi
Edi

Reputation: 3

doxygen \code tag breaks html tags on the same page

this is my first question ever here.

I have a strange problem when I use doxygen for documenting my C++ code. As soon as I have a \code tag on a page all html tags are not processed in the output.

The first example shows what I expected from the html tags. In the second example I just add a doxygen \code tag and the complete output is corrupt.

Example 1:

//!   \page testpage Test Page
//!
//!   <ul>
//!     <li>\ref test_section1</li>
//!     <li>\ref test_section2</li>
//!   </ul>
//!
//!   \section test_section1 Test Section 1
//!
//!   Any text.
//!
//!   \section test_section2 Test Section 2
//!
//!   Any text.
//!   <br><br>

doxygen result of the first example

Example 2:

//!   \page testpage Test Page
//!
//!   <ul>
//!     <li>\ref test_section1</li>
//!     <li>\ref test_section2</li>
//!   </ul>
//!
//!   \section test_section1 Test Section 1
//!
//!   Any text.
//!
//!   \code
//!   if (x==1) return;
//!   \endcode
//!
//!   \section test_section2 Test Section 2
//!
//!   Any text.
//!   <br><br>

doxygen result of the second example

By the way I'm using doxygen 1.8.5 on linux.

Upvotes: 0

Views: 409

Answers (1)

albert
albert

Reputation: 9012

Using the current version of doxygen (1.8.12) solves the problem.

A better result in 1.8.5 can be obtained by disabling the Markdown support (MARKDOWN_SUPPORT = NO) in the doxygen configuration file (Doxyfile).

A good result can be also be obtained by using the following form of the code:

    /**
   \page testpage2 Test2 Page

   <ul>
     <li>\ref test_section1</li>
     <li>\ref test_section2</li>
   </ul>

   \section test_section1 Test Section 1

   Any text.

   \code
   if (x==1) return;
   \endcode

   \section test_section2 Test Section 2

   Any text.
   <br><br>
*/

and this goes independent of the setting of MARKDOWN_SUPPORT.

Advise is anyway use the current version (1.8.12).

Upvotes: 1

Related Questions