You are here

abstract protected function BaseParser::convertToHtml in Markdown 8.2

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

Converts Markdown into HTML.

Note: this method is not guaranteed to be safe from XSS attacks. This returns the raw output from the parser itself.

If you need to render this output you should use the \Drupal\markdown\Plugin\Markdown\MarkdownParserInterface::parse() method instead.

@internal

Parameters

string $markdown: The markdown string to convert.

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

Return value

string The raw parsed HTML returned from the parser.

See also

\Drupal\markdown\Render\ParsedMarkdownInterface

\Drupal\markdown\Plugin\Markdown\ParserInterface::parse()

1 call to BaseParser::convertToHtml()
BaseParser::parse in src/Plugin/Markdown/BaseParser.php
Parses markdown into HTML.
4 methods override BaseParser::convertToHtml()
Cmark::convertToHtml in src/Plugin/Markdown/Pecl/Cmark.php
Converts Markdown into HTML.
CommonMark::convertToHtml in src/Plugin/Markdown/CommonMark/CommonMark.php
Converts Markdown into HTML.
Parsedown::convertToHtml in src/Plugin/Markdown/Parsedown/Parsedown.php
Converts Markdown into HTML.
PhpMarkdown::convertToHtml in src/Plugin/Markdown/PhpMarkdown/PhpMarkdown.php
Converts Markdown into HTML.

File

src/Plugin/Markdown/BaseParser.php, line 103

Class

BaseParser
Base class form Markdown Parser instances.

Namespace

Drupal\markdown\Plugin\Markdown

Code

protected abstract function convertToHtml($markdown, LanguageInterface $language = NULL);