public static function processMarkdown($string, $block = true)
    {
        $page     = Grav::instance()['page'] ?? null;
        $defaults = Grav::instance()['config']->get('system.pages.markdown');

        // Initialize the preferred variant of Parsedown
        if ($defaults['extra']) {
            $parsedown = new ParsedownExtra($page, $defaults);
        } else {
            $parsedown = new Parsedown($page, $defaults);
        }

        if ($block) {
            $string = $parsedown->text($string);
        } else {
            $string = $parsedown->line($string);
        }

        return $string;
    }
public static function processMarkdown($string, $block = true)
    {
        $page     = Grav::instance()['page'] ?? null;
        $defaults = Grav::instance()['config']->get('system.pages.markdown');

        // Initialize the preferred variant of Parsedown
        if ($defaults['extra']) {
            $parsedown = new ParsedownExtra($page, $defaults);
        } else {
            $parsedown = new Parsedown($page, $defaults);
        }

        if ($block) {
            $string = $parsedown->text($string);
        } else {
            $string = $parsedown->line($string);
        }

        return $string;
    }
public static function processMarkdown ( $ string , $ block = true ) { $ page = Grav :: instance ( ) [ 'page' ] ?? null ; $ defaults = Grav :: instance ( ) [ 'config' ] -> get ( 'system.pages.markdown' ) ; // Initialize the preferred variant of Parsedown if ( $ defaults [ 'extra' ] ) { $ parsedown = new ParsedownExtra ( $ page , $ defaults ) ; } else { $ parsedown = new Parsedown ( $ page , $ defaults ) ; } if ( $ block ) { $ string = $ parsedown -> text ( $ string ) ; } else { $ string = $ parsedown -> line ( $ string ) ; } return $ string ; }
Process a string as markdown

@param string $string

@param bool $block  Block or Line processing
@return string
Process a string as markdown