app/Filter.php
public static function markdown(string $text, Tree $tree): string
    {
        $environment = Environment::createCommonMarkEnvironment();
        $environment->mergeConfig(['html_input' => 'escape']);
        $environment->addExtension(new TableExtension());
        $environment->addExtension(new CensusTableExtension());
        $environment->addExtension(new XrefExtension($tree));

        $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

        try {
            return $converter->convertToHtml($text);
        } catch (Throwable $ex) {
            // See issue #1824
            return $text;
        }
    }
public static function markdown(string $text, Tree $tree): string
    {
        $environment = Environment::createCommonMarkEnvironment();
        $environment->mergeConfig(['html_input' => 'escape']);
        $environment->addExtension(new TableExtension());
        $environment->addExtension(new CensusTableExtension());
        $environment->addExtension(new XrefExtension($tree));

        $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));

        try {
            return $converter->convertToHtml($text);
        } catch (Throwable $ex) {
            // See issue #1824
            return $text;
        }
    }
public static function markdown ( string $ text , Tree $ tree ) : string { $ environment = Environment :: createCommonMarkEnvironment ( ) ; $ environment -> mergeConfig ( [ 'html_input' => 'escape' ] ) ; $ environment -> addExtension ( new TableExtension ( ) ) ; $ environment -> addExtension ( new CensusTableExtension ( ) ) ; $ environment -> addExtension ( new XrefExtension ( $ tree ) ) ; $ converter = new Converter ( new DocParser ( $ environment ) , new HtmlRenderer ( $ environment ) ) ; try { return $ converter -> convertToHtml ( $ text ) ; } catch ( Throwable $ ex ) { // See issue #1824 return $ text ; } }
Format a block of text, using "Markdown".

@param string $text
@param Tree   $tree

@return string
Format a block of text using Markdown .