You are here

public static function MarkdownInterface::load in Markdown 3.0.x

Same name and namespace in other branches
  1. 8.2 src/MarkdownInterface.php \Drupal\markdown\MarkdownInterface::load()

Loads a cached ParsedMarkdown object.

Parameters

string $id: A unique identifier that will be used to cache the parsed markdown.

string $markdown: Optional. The fallback markdown to parse if the cached ParsedMarkdown object doesn't yet exist. If provided, it will be parsed and its identifier set to the provided $id and then cached.

string $parser: Optional. The plugin identifier of the MarkdownParser to retrieve. If not provided, the first enabled Markdown filter in a text formatter available to the current user is used.

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.

\Drupal\Core\Language\LanguageInterface $language: Optional. The language of the text that is being converted.

Return value

\Drupal\markdown\ParsedMarkdownInterface|null A ParsedMarkdown object or NULL if it doesn't exist and $markdown was not provided as a fallback.

1 method overrides MarkdownInterface::load()
Markdown::load in src/Markdown.php
Loads a cached ParsedMarkdown object.

File

src/MarkdownInterface.php, line 41

Class

MarkdownInterface
Interface MarkdownInterface.

Namespace

Drupal\markdown

Code

public static function load($id, $markdown = NULL, $parser = NULL, $filter = NULL, AccountInterface $account = NULL, LanguageInterface $language = NULL);