You are here

public function ExternalLinkExtension::getSettings in Markdown 8.2

Retrieves the current settings.

Parameters

bool $runtime: Flag indicating whether the request is for runtime values, which may or may not need to be transformed for whatever is consuming it.

bool $sorted: Flag indicating whether to sort they settings by property name to ensure they're always in the same order (configuration consistency).

Return value

array The settings array

Overrides SettingsInterface::getSettings

File

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

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 getSettings($runtime = FALSE, $sorted = TRUE) {
  $settings = $this
    ->getSettingsTrait($runtime, $sorted);
  if (!$runtime) {
    return $settings;
  }
  $token = \Drupal::token();
  foreach ($settings['internal_hosts'] as &$host) {
    $host = $token
      ->replace($host);
  }
  $settings['internal_hosts'] = array_unique($settings['internal_hosts']);
  return $settings;
}