Doxygen fails to parse fenced code blocks in a markdown file. Here’s my snippet:
~~~~~~~~~~~~~~~~~~~~{.cpp}
#include <cstdio>
int main() {
printf("Hello World");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~
This appears in the output as plaintext.
int main() { printf("Hello World"); } ~~~~~~~~~~~~~~~~~~~~~~~~~~
What is my mistake here?
This looks trivial in hindsight, but I spent a lot of time debugging it, so thought I should share it with the community. The problem was that the number of tildes
~at the start and end of the fenced block should be equal.Minimum 3 tildes are required to mark a fenced block, but to make the fenced block more easily visible, I like extending them to the complete line. I had originally copy-pasted the starting line at the end, but I then removed a few
~s to make room for the{.cpp}.