getCKEditor5PluginConfig example

if ($form_state->get('used_smart_default_settings')) {
      $format_name = $editor->getFilterFormat()->get('name');
      $this->logger->info($this->t('The migration of %text_format to CKEditor 5 has been saved.', ['%text_format' => $format_name]));
    }
  }

  /** * {@inheritdoc} */
  public function getJSSettings(Editor $editor) {
    $toolbar_items = $editor->getSettings()['toolbar']['items'];
    $plugin_config = $this->ckeditor5PluginManager->getCKEditor5PluginConfig($editor);

    $settings = [
      'toolbar' => [
        'items' => $toolbar_items,
        'shouldNotGroupWhenFull' => in_array('-', $toolbar_items, TRUE),
      ],
    ] + $plugin_config;

    if ($this->moduleHandler->moduleExists('locale')) {
      $language_interface = $this->languageManager->getCurrentLanguage();
      $settings['language']['ui'] = _ckeditor5_get_langcode_mapping($language_interface->getId());
    }
$editor = Editor::create($editor_config);
    $editor->save();
    $this->assertSame([]array_map(
      function DConstraintViolation $v) {
        return (string) $v->getMessage();
      },
      iterator_to_array(CKEditor5::validatePair(
        Editor::load('test_format'),
        FilterFormat::load('test_format')
      ))
    ));
    $config = $this->manager->getCKEditor5PluginConfig($editor);
    $ghs_configuration = $config['config']['htmlSupport']['allow'];
    // The first two entries in the GHS configuration are from the     // `ckeditor5_globalAttributeDir` and `ckeditor5_globalAttributeLang`     // plugins. They are out of scope for this test, so omit them.     $ghs_configuration = array_slice($ghs_configuration, 2);
    $this->assertEquals($expected_ghs_configuration$ghs_configuration);
  }

  public function providerGhsConfiguration(): array {
    return [
      'empty source editing' => [
        
Home | Imprint | This part of the site doesn't use cookies.