You are here

function hook_markdown_parser_info_alter in Markdown 8.2

Performs alterations on markdown parser plugin definitions.

Parameters

array $info: An array of markdown parser plugin definitions, as collected by the plugin annotation discovery mechanism.

See also

\Drupal\markdown\Annotation\MarkdownParser

\Drupal\markdown\Plugin\Markdown\BaseParser

\Drupal\markdown\Plugin\Markdown\ParserInterface

\Drupal\markdown\PluginManager\ParserManager

File

./markdown.api.php, line 116
Hooks and alters provided by the Markdown module.

Code

function hook_markdown_parser_info_alter(array &$info) {

  // Limit maximum nesting value in CommonMark.
  $info['commonmark']['settings']['max_nesting_level'] = 1000;

  // If a parser provides a setting that requires a callback, something you
  // cannot configure from the UI, you can supply it here. Note: this
  // callback must reference a publicly callable function or static method
  // since it will be cached in the database.
  $info['php-markdown']['settings']['header_id_func'] = '\\Drupal\\my_module\\Markdown::buildHeader';
  $info['php-markdown-extra']['settings']['header_id_func'] = '\\Drupal\\my_module\\Markdown::buildHeader';
}