function ListPlugin::getElementsSubset

Same name and namespace in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/ListPlugin.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin::getElementsSubset()
  2. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/ListPlugin.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\ListPlugin::getElementsSubset()

Overrides CKEditor5PluginElementsSubsetInterface::getElementsSubset

File

core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/ListPlugin.php, line 81

Class

ListPlugin
CKEditor 5 List plugin.

Namespace

Drupal\ckeditor5\Plugin\CKEditor5Plugin

Code

public function getElementsSubset() : array {
    $subset = $this->getPluginDefinition()
        ->getElements();
    $subset = array_diff($subset, [
        '<ol reversed start>',
    ]);
    $reversed_enabled = $this->getConfiguration()['reversed'];
    $start_index_enabled = $this->getConfiguration()['startIndex'];
    $subset[] = "<ol" . ($reversed_enabled ? ' reversed' : '') . ($start_index_enabled ? ' start' : '') . '>';
    return $subset;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.