You are here

public function ExternalLinkExtension::getConfiguration in Markdown 8.2

Gets this plugin's configuration.

Return value

array An array of this plugin's configuration.

Overrides BaseExtension::getConfiguration

File

src/Plugin/Markdown/CommonMark/Extension/ExternalLinkExtension.php, line 160

Class

ExternalLinkExtension
Plugin annotation @MarkdownAllowedHtml( id = "commonmark-external-links", ) @MarkdownExtension( id = "commonmark-external-links", label = @Translation("External Links"), description = @Translation("Automatically detect links to external sites…

Namespace

Drupal\markdown\Plugin\Markdown\CommonMark\Extension

Code

public function getConfiguration() {
  $configuration = parent::getConfiguration();

  // Normalize settings from a key|value string into an associative array.
  foreach ([
    'internal_hosts',
  ] as $name) {
    if (isset($configuration['settings'][$name])) {
      $configuration['settings'][$name] = KeyValuePipeConverter::normalize($configuration['settings'][$name]);
    }
  }
  return $configuration;
}