You are here

public function Markdown::parse in Markdown 8.2

Same name and namespace in other branches
  1. 3.0.x src/Markdown.php \Drupal\markdown\Markdown::parse()

Parses markdown into HTML.

Parameters

string $markdown: The markdown string to parse.

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

Return value

\Drupal\markdown\Render\ParsedMarkdownInterface A ParsedMarkdown object.

Overrides MarkdownInterface::parse

2 calls to Markdown::parse()
Markdown::loadFile in src/Markdown.php
Loads a cached ParsedMarkdown object based on system file.
Markdown::loadUrl in src/Markdown.php
Loads a cached ParsedMarkdown object based on a URL.

File

src/Markdown.php, line 166

Class

Markdown
Markdown service.

Namespace

Drupal\markdown

Code

public function parse($markdown, LanguageInterface $language = NULL) {
  return $this
    ->getParser()
    ->parse($markdown, $language);
}