GNOME Bugzilla – Bug 681281
Markdown indent-syntax code block copies initial indent
Last modified: 2012-08-11 13:18:27 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.
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?
(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.
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.
That sounds great, thanks.
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.