League\CommonMark\Environment::createCommonMarkEnvironment PHP Method

createCommonMarkEnvironment() public static method

public static createCommonMarkEnvironment ( ) : Environment
return Environment
    public static function createCommonMarkEnvironment()
    {
        $environment = new static();
        $environment->addExtension(new CommonMarkCoreExtension());
        $environment->mergeConfig(['renderer' => ['block_separator' => "\n", 'inner_separator' => "\n", 'soft_break' => "\n"], 'safe' => false, 'html_input' => self::HTML_INPUT_ALLOW, 'allow_unsafe_links' => true]);
        return $environment;
    }

Usage Example

Beispiel #1
0
 /**
  * Create and return a CommonMark environment
  *
  * @return Environment CommonMark environment
  */
 protected function environment()
 {
     // Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go
     $environment = Environment::createCommonMarkEnvironment();
     // Custom environment initialization
     return $this->initializeEnvironment($environment);
 }
All Usage Examples Of League\CommonMark\Environment::createCommonMarkEnvironment