You are here

public function ExternalLinkExtension::setConfiguration in Markdown 8.2

Sets the configuration for this plugin instance.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Overrides InstallablePluginBase::setConfiguration

File

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

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 setConfiguration(array $configuration) {

  // 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 parent::setConfiguration($configuration);
}