You are here

public function FootnoteExtension::allowedHtmlTags in Markdown 8.2

Retrieves the allowed HTML tags.

Parameters

\Drupal\markdown\Plugin\Markdown\ParserInterface $parser: The parser associated with this plugin.

\Drupal\Core\Theme\ActiveTheme $activeTheme: Optional. The active them. This is used as an indicator when in "render mode".

Return value

array An associative array of allowed HTML tags.

Overrides AllowedHtmlInterface::allowedHtmlTags

File

src/Plugin/Markdown/CommonMark/Extension/FootnoteExtension.php, line 64

Class

FootnoteExtension
Footnotes extension.

Namespace

Drupal\markdown\Plugin\Markdown\CommonMark\Extension

Code

public function allowedHtmlTags(ParserInterface $parser, ActiveTheme $activeTheme = NULL) {
  $tags = [
    'a' => [
      'href' => TRUE,
      'role' => TRUE,
      'rev' => TRUE,
    ],
    'div' => [
      'class' => TRUE,
      'id' => TRUE,
      'role' => TRUE,
    ],
    'li' => [
      'class' => TRUE,
      'id' => TRUE,
      'role' => TRUE,
    ],
    'ol' => [],
    'sup' => [
      'id' => TRUE,
    ],
  ];
  if (!$this
    ->isPreferredLibraryInstalled() || $parser instanceof ExtensibleParserInterface && ($extension = $parser
    ->extension($this->pluginId)) && $extension instanceof SettingsInterface && $extension
    ->getSetting('container_add_hr')) {
    $tags['hr'] = [];
  }
  return $tags;
}