src/Mpociot/Reflection/DocBlock/Description.php
public function getFormattedContents()
    {
        $result = $this->contents;

        // if the long description contains a plain HTML <code> element, surround
        // it with a pre element. Please note that we explicitly used str_replace
        // and not preg_replace to gain performance
        if (strpos($result, '<code>') !== false) {
            $result = str_replace(
                array('<code>', "<code>\r\n", "<code>\n", "<code>\r", '</code>'),
                array('<pre><code>', '<code>', '<code>', '<code>', '</code></pre>'),
                $result
            );
        }

        if (class_exists('Parsedown')) {
            $markdown = \Parsedown::instance();
            $result = $markdown->parse($result);
        } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) {
            $markdown = new \dflydev\markdown\MarkdownExtraParser();
            $result = $markdown->transformMarkdown($result);
        }

        return trim($result);
    }
public function getFormattedContents()
    {
        $result = $this->contents;

        // if the long description contains a plain HTML <code> element, surround
        // it with a pre element. Please note that we explicitly used str_replace
        // and not preg_replace to gain performance
        if (strpos($result, '<code>') !== false) {
            $result = str_replace(
                array('<code>', "<code>\r\n", "<code>\n", "<code>\r", '</code>'),
                array('<pre><code>', '<code>', '<code>', '<code>', '</code></pre>'),
                $result
            );
        }

        if (class_exists('Parsedown')) {
            $markdown = \Parsedown::instance();
            $result = $markdown->parse($result);
        } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) {
            $markdown = new \dflydev\markdown\MarkdownExtraParser();
            $result = $markdown->transformMarkdown($result);
        }

        return trim($result);
    }
public function getFormattedContents ( ) { $ result = $ this -> contents ; // if the long description contains a plain HTML <code> element, surround // it with a pre element. Please note that we explicitly used str_replace // and not preg_replace to gain performance if ( strpos ( $ result , '<code>' ) !== false ) { $ result = str_replace ( array ( '<code>' , "<code>\r\n" , "<code>\n" , "<code>\r" , '</code>' ) , array ( '<pre><code>' , '<code>' , '<code>' , '<code>' , '</code></pre>' ) , $ result ) ; } if ( class_exists ( 'Parsedown' ) ) { $ markdown = \ Parsedown :: instance ( ) ; $ result = $ markdown -> parse ( $ result ) ; } elseif ( class_exists ( 'dflydev\markdown\MarkdownExtraParser' ) ) { $ markdown = new \ dflydev \ markdown \ MarkdownExtraParser ( ) ; $ result = $ markdown -> transformMarkdown ( $ result ) ; } return trim ( $ result ) ; }
Return a formatted variant of the Long Description using MarkDown.

@todo this should become a more intelligent piece of code where the
configuration contains a setting what format long descriptions are.

@codeCoverageIgnore Will be removed soon, in favor of adapters at
PhpDocumentor itself that will process text in various formats.

@return string
Return a formatted variant of the Long Description using MarkDown .