CKEditor5Plugin example

public function providerCandidates(): \Generator {
    $generate_definition = function Dstring $label_and_id, array $overrides): CKEditor5PluginDefinition {
      $annotation = [
        'provider' => 'test',
        'id' => "test_$label_and_id",
        'drupal' => ['label' => "$label_and_id"],
        'ckeditor5' => ['plugins' => []],
      ];
      foreach ($overrides as $path => $value) {
        NestedArray::setValue($annotationexplode('.', $path)$value);
      }
      $annotation_instance = new CKEditor5Plugin($annotation);
      $definition = $annotation_instance->get();
      return $definition;
    };

    yield 'Tag needed, no match due to no plugin supporting it' => [
      HTMLRestrictions::emptySet(),
      HTMLRestrictions::fromString('<foo>'),
      [
        $generate_definition('foo', ['drupal.elements' => FALSE]),
      ],
      [],
      [],
Home | Imprint | This part of the site doesn't use cookies.