3
votes

I observe that with doxygen 1.8.2, fenced code blocks cannot be placed in an indented list at indentation level more than 2 (in a markdown file). In the below snippet:

- Level 1

~~~
printf("Hello world Level 1");
~~~

  - Level 2

  ~~~
  printf("Hello world Level 2");
  ~~~

    - Level 3

    ~~~
    printf("Hello world Level 3");
    ~~~

The Hello world Level 1 and Hello world Level 2 appear in the output as code snippets, but the Hello world Level 3 (and the ~s around it) appear as plaintext output.

What is the mistake I have made, or is this a known limitation?

1

1 Answers

5
votes

It is a limitation (or bug if you will).

Normally everything that is indented with 4 or more spaces will be shown verbatim (code block), but for lists the relative indent counts as the indentation (so 2 spaces in your example). Since the fenced block is handled before the lists are resolved, you get that the fenced block is not seen as such (too much indentation during this pass) but also not turned into verbatim section later on (due to the relative indentation during that pass).