You are here

public function BaseParser::getUrl in Markdown 3.0.x

Retrieves the URL for the parser, if any.

Return value

string|null

Overrides MarkdownParserInterface::getUrl

File

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

Class

BaseParser
Plugin annotation @MarkdownParser( id = "_broken", label = @Translation("Missing Parser"), )

Namespace

Drupal\markdown\Plugin\Markdown

Code

public function getUrl() {
  $url = $this->pluginDefinition['url'] ?? NULL;
  if ($url && UrlHelper::isExternal($url)) {
    return Url::fromUri($url);
  }
  return $url ? Url::fromUserInput($url) : NULL;
}