You are here

public static function ParsedMarkdown::normalizeMarkdown in Markdown 3.0.x

Normalizes markdown.

Parameters

string $markdown: The markdown to normalize.

Return value

string The normalized markdown.

Overrides ParsedMarkdownInterface::normalizeMarkdown

2 calls to ParsedMarkdown::normalizeMarkdown()
ParsedMarkdown::getMarkdown in src/ParsedMarkdown.php
Retrieves the raw markdown source.
ParsedMarkdown::matches in src/ParsedMarkdown.php
Compares whether the provided markdown matches this object.

File

src/ParsedMarkdown.php, line 198

Class

ParsedMarkdown

Namespace

Drupal\markdown

Code

public static function normalizeMarkdown($markdown) {
  return $markdown === '' ? '' : preg_replace('/\\r\\n|\\n/', "\n", (string) $markdown);
}