You are here

public static function CommonMark::defaultSettings in Markdown 8.2

Overrides SettingsTrait::defaultSettings

File

src/Plugin/Markdown/CommonMark/CommonMark.php, line 108

Class

CommonMark
Support for CommonMark by The League of Extraordinary Packages.

Namespace

Drupal\markdown\Plugin\Markdown\CommonMark

Code

public static function defaultSettings($pluginDefinition) {

  /* @var \Drupal\markdown\Annotation\InstallablePlugin $pluginDefinition */

  // CommonMark didn't have configuration until 0.6.0.
  if (!$pluginDefinition->version || Semver::satisfies($pluginDefinition->version, '<0.6.0')) {
    return [];
  }
  return [
    'allow_unsafe_links' => TRUE,
    'enable_em' => TRUE,
    'enable_strong' => TRUE,
    'html_input' => 'escape',
    'max_nesting_level' => 0,
    'renderer' => [
      'block_separator' => "\n",
      'inner_separator' => "\n",
      'soft_break' => "\n",
    ],
    'use_asterisk' => TRUE,
    'use_underscore' => TRUE,
    'unordered_list_markers' => [
      '-',
      '*',
      '+',
    ],
  ] + parent::defaultSettings($pluginDefinition);
}