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 681281 - Markdown indent-syntax code block copies initial indent
Markdown indent-syntax code block copies initial indent
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.1.2
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2012-08-06 08:32 UTC by Michał Górny
Modified: 2012-08-11 13:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michał Górny 2012-08-06 08:32:23 UTC
I'm using the indent-syntax to create code blocks in doxygen/markdown files alike:

    int some_random_code();

(indenting using a single tab)

For that, I'd expect (and that's what markdown parsers do):

<pre>int some_random_code();</pre>

But instead, doxygen gives me:

<pre>    int some_random_code();
</pre>

In other words, the initial indent is copied into the code while it should be stripped.
Comment 1 Dimitri van Heesch 2012-08-06 09:10:32 UTC
Hi Michal,

Doxygen replaces tabs by spaces before doing Markdown processing according to the TAB_SIZE setting in the config file.
Doxygen does strip the 4 spaces that are required for a block from the block's contents.

If TAB_SIZE is 8, then still 4 spaces (of the 8 spaces that made up the tab) are left unstripped.
If TAB_SIZE is 4, then the indent should be stripped correctly.

Can you check if this fixes the problem?
Comment 2 Michał Górny 2012-08-06 09:24:42 UTC
(In reply to comment #1)
> Doxygen replaces tabs by spaces before doing Markdown processing according to
> the TAB_SIZE setting in the config file.
> Doxygen does strip the 4 spaces that are required for a block from the block's
> contents.
> 
> If TAB_SIZE is 8, then still 4 spaces (of the 8 spaces that made up the tab)
> are left unstripped.
> If TAB_SIZE is 4, then the indent should be stripped correctly.
> 
> Can you check if this fixes the problem?

Yes, indeed it does. Could you please at least mention that in the docs? I believe it's a deviation from the standard Markdown which expects either 4 spaces or 1 tab, and it can be a bit confusing to people using Markdown before.
Comment 3 Dimitri van Heesch 2012-08-06 09:35:41 UTC
I agree.

I will make the default for TAB_SIZE 4, and plan to add the following text:

"
Markdown allows both a single tab or 4 spaces to start a code block.
Since doxygen already replaces tabs by spaces before doing Markdown
processing, the effect will only be same if TAB_SIZE in the config file
has been set to 4. When it is set to a higher value spaces will be present in the code block. A lower value will prevent a single tab to be interpreted as the start of a code block.
"

Please review this text and let me know if you have any comments.
Comment 4 Michał Górny 2012-08-06 09:54:41 UTC
That sounds great, thanks.
Comment 5 Dimitri van Heesch 2012-08-11 13:18:27 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.2. 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.