You are here

public function MarkdownParserManager::getParser in Markdown 3.0.x

Retrieves a parser based on a filter and its settings.

Parameters

string|\Drupal\filter\Plugin\FilterInterface|\Drupal\filter\FilterFormatInterface $filter: Optional A specific filter plugin to use, a string representing a filter format or a FilterFormatInterface object containing a "markdown" filter.

\Drupal\Core\Session\AccountInterface $account: Optional. An account used to retrieve filters available filters if one wasn't already specified.

Return value

\Drupal\markdown\Plugin\Markdown\MarkdownParserInterface A MarkdownParser plugin.

Overrides MarkdownParserManagerInterface::getParser

File

src/MarkdownParserManager.php, line 163

Class

MarkdownParserManager

Namespace

Drupal\markdown

Code

public function getParser($filter = NULL, AccountInterface $account = NULL) : MarkdownParserInterface {
  return $this
    ->createInstance(NULL, [
    'filter' => $filter,
    'account' => $account,
  ]);
}