You are here

public static function Markdown::defaultTransform in Express 8

* Simple function interface - Initialize the parser and return the result * of its transform method. This will work fine for derived classes too. * * @api * *

Parameters

string $text: * @return string

Overrides MarkdownInterface::defaultTransform

1 call to Markdown::defaultTransform()
Readme.php in vendor/michelf/php-markdown/Readme.php

File

vendor/michelf/php-markdown/Michelf/Markdown.php, line 32

Class

Markdown
Markdown Parser Class

Namespace

Michelf

Code

public static function defaultTransform($text) {

  // Take parser class on which this function was called.
  $parser_class = \get_called_class();

  // Try to take parser from the static parser list
  static $parser_list;
  $parser =& $parser_list[$parser_class];

  // Create the parser it not already set
  if (!$parser) {
    $parser = new $parser_class();
  }

  // Transform text using parser.
  return $parser
    ->transform($text);
}