You are here

public function ParsedMarkdown::matches in Markdown 8.2

Compares whether the provided markdown matches this object.

Parameters

string|\Drupal\markdown\Render\ParsedMarkdownInterface $markdown: An external markdown source.

Return value

bool TRUE or FALSE

Overrides ParsedMarkdownInterface::matches

File

src/Render/ParsedMarkdown.php, line 168

Class

ParsedMarkdown
The end result of parsing markdown into HTML.

Namespace

Drupal\markdown\Render

Code

public function matches($markdown) {
  if ($markdown instanceof static) {
    return $markdown
      ->getMarkdown() === $this
      ->getMarkdown();
  }
  return static::normalizeMarkdown($markdown) === $this
    ->getMarkdown();
}