New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown fenced code block not parsed (Origin: bugzilla #692162) #5040

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.8.3.1 on platform Other
Assigned to: Dimitri van Heesch

On 2013-01-21 01:46:10 +0000, Donald Tournier wrote:

Overview:

Markdown fenced code block interpreted as normal text when indent is large (>4).

Steps to Reproduce:

  • Create file example.h with contents:
namespace NS1 {
  namespace NS2 {

    //! My class to do blah.
    /*! This class does blah.
        Example usage:
        ~~~~
        MyClass bogus;
        bogus.some_function();
        ~~~~
     */
    class MyClass {
      public:
        MyClass();
    }

  }
}
  • Create Doxyfile:
    $ doxygen -g

  • Edit Doxyfile and set INPUT to example.h

  • run doxygen:
    $ doxygen

Actual Result:

Detailed description section contains:

This class does blah. Example usage: ~~~~ MyClass bogus; bogus.some_function(); ~~~~

Expected Result:

Text between '~~~~' lines should be interpreted as code and formatted as such.

Version & Platform:

version 1.8.3.1, Arch Linux 64-bit

Additional Information:

The example above can be made to behave correctly by:

  • removing some spaces before the first '~~~~' to reduce the indent to less than 4

  • inserting a newline after the start of the main comment block as follows:

    /*!
    This class does blah.
    Example usage:
    ~~~~
    MyClass bogus;
    bogus.some_function();
    ~~~~
    */

What happens in the original case is that in isFencedCodeBlock() (src/markdown.cpp, line 1319), the refIndent variable is zero (checked by modifying 1.8.3.1 source and printing out variable).

The isFencedCodeBlock() function does not check for the start of the code block beyond an indent of 4+refIndent, as this seems to be handled by the indented markdown code block isCodeBlock() function. So reducing the indent allows the start of the fenced code block to be detected.

When the newline is inserted at the start of the comment block, the refIndent is correct.

On 2013-01-26 10:57:16 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next subversion update.

On 2013-05-19 12:36:01 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.4. 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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment