Skip to content

Improve support for code blocks in included markdown files #11225

@AdarshRawat1

Description

@AdarshRawat1

Describe the bug

When a markdown is included in other markdown using \include{doc} "./Secondary.md" Then, the output of code snippets breaks.

Screenshots

  • image

  • image

Observations

This happens only if there is formatting in the primary markdown - like ( BOLD , Italic ). if we remove the formattings from primary markdown then everything works fine, but we can't avoid using formatting, so I tried few workarounds one of them worked.

i.e. There is a need to handle the formatting edge cases.

Temporary Fix

  • This version gives correct output but \code{.c} doesn't work on GitHub Renders, so I have to keep 2 copies of the same code in docs. (One for Doxygen and one for GitHub )
\code{.c}
    struct secondary_struct {
        int a ; 
        int b ; 
    }
\endcode

p.s. I've been on this for quite some time

To Reproduce

Use this Zip - includedocs.zip

Expected behavior

Correctly formatted code snippets

Version

1.12.0 (Windows 11, WSL, Ubuntu)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions