public function Parsedown::getParsedown in Markdown 8.2
Retrieves the Parsedown instance.
Return value
\Parsedown A PHP Markdown parser.
File
- src/
Plugin/ Markdown/ Parsedown/ Parsedown.php, line 184
Class
- Parsedown
- Support for Parsedown by Emanuil Rusev.
Namespace
Drupal\markdown\Plugin\Markdown\ParsedownCode
public function getParsedown() {
if (!$this->parsedown) {
$this->parsedown = new static::$parsedownClass();
$settings = $this
->getSettings();
// Unless the render strategy is set to "none", force the
// following settings to be disabled.
if ($this
->getRenderStrategy() !== static::NONE) {
$settings['markup_escaped'] = FALSE;
$settings['safe_mode'] = FALSE;
}
foreach ($settings as $name => $value) {
if ($method = $this
->getSettingMethod($name)) {
$this->parsedown
->{$method}($value);
}
}
}
return $this->parsedown;
}