2
votes

We have a large C++ project that makes extensive use of Doxygen. When Doxygen added markdown support, our generated documentation suddenly had unwanted "boxed" code blocks containing the first comment lines of many documented classes and members. Disabling markdown support fixed the problem, but we would like to be able to use markdown.

The problem is apparently our use of the /** style for Doxygen comments. For compactness, we begin the comment on the same line, especially for short comments, and we don't indent the rest of the comment. I am guessing that Doxygen sends that to markdown as an indented line so markdown puts it in a code block. Comments like this work fine:

/** This a short comment (works). */

But comments like this end up treating the first line as though it had been placed in a code block:

/** This is a somewhat longer comment that ended up
being wrapped to a second line (first line treated as code). */

Reformatting in either of the following ways fixes the problem:

/** This is a somewhat longer comment that ended up
    being wrapped to a second line (works). */

/** 
This is a somewhat longer comment that ended up
being wrapped to a second line (works). */

We have thousands of classes and members documented in the compact form above and would like to be able to enable markdown without changing this style. Is there any way to get Doxygen not to generate these unwanted code blocks?

I am using Doxygen 1.8.5.

1
As an experiment I've just extended the scope of my markdown-focussed doxygen INPUT to include a large body of C++ code. I'm not seeing this, but then our C++ comments have a preceding asterisk in down the left hand side, so that's probably a 3rd case that does work. Sorry that's not much help towards your problem, as such. - Cheeseminer

1 Answers

1
votes

I see your problem and I expect that it would be very rare that a user would actually want to start a comment with a code block.

To change this in doxygen is actually quite easy. If you could file this as a bug report here: https://bugzilla.gnome.org/enter_bug.cgi?product=doxygen then I'll push a fix to GitHub for this bug.