You are here

public static function FilterMarkdown::ajaxChangeParser in Markdown 8.2

The AJAX callback used to return the parser ajax wrapper.

1 call to FilterMarkdown::ajaxChangeParser()
SettingsForm::ajaxChangeParser in src/Form/SettingsForm.php
The AJAX callback used to return the parser ajax wrapper.

File

src/Plugin/Filter/FilterMarkdown.php, line 427

Class

FilterMarkdown
Provides a filter for Markdown.

Namespace

Drupal\markdown\Plugin\Filter

Code

public static function ajaxChangeParser(array $form, FormStateInterface $form_state) {

  // Immediately return if subform parents aren't known.
  if (!($arrayParents = $form_state
    ->get('markdownSubformArrayParents'))) {
    $arrayParents = array_slice($form_state
      ->getTriggeringElement()['#array_parents'], 0, -2);
  }
  $subform =& NestedArray::getValue($form, $arrayParents);
  return $subform['ajax'];
}