function ValidatorsTest::providerPair
Same name in other branches
- 9 core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php \Drupal\Tests\ckeditor5\Kernel\ValidatorsTest::providerPair()
- 11.x core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php \Drupal\Tests\ckeditor5\Kernel\ValidatorsTest::providerPair()
Provides a list of Text Editor + Text Format pairs to test.
File
-
core/
modules/ ckeditor5/ tests/ src/ Kernel/ ValidatorsTest.php, line 712
Class
- ValidatorsTest
- @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemConstraintValidator @covers \Drupal\ckeditor5\Plugin\Validation\Constraint\ToolbarItemDependencyConstraintValidator @covers…
Namespace
Drupal\Tests\ckeditor5\KernelCode
public static function providerPair() : array {
// cspell:ignore donk
$data = [];
$data['INVALID: allow_view_mode_override condition not met: filter must be configured to allow 2 or more view modes'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [
'media_media' => [
'allow_view_mode_override' => TRUE,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'media_embed' => [
'id' => 'media_embed',
'provider' => 'media',
'status' => TRUE,
'weight' => 0,
'settings' => [
'default_view_mode' => 'default',
'allowed_view_modes' => [],
'allowed_media_types' => [],
],
],
],
'expected_violations' => [
'' => 'The CKEditor 5 "<em class="placeholder">Media</em>" plugin\'s "<em class="placeholder">Allow the user to override the default view mode</em>" setting should be in sync with the "<em class="placeholder">Embed media</em>" filter\'s "<em class="placeholder">View modes selectable in the "Edit media" dialog</em>" setting: when checked, two or more view modes must be allowed by the filter.',
],
];
$data['VALID: allow_view_mode_override condition met: filter must be configured to allow 2 or more view modes'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalMedia',
],
],
'plugins' => [
'media_media' => [
'allow_view_mode_override' => TRUE,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'media_embed' => [
'id' => 'media_embed',
'provider' => 'media',
'status' => TRUE,
'weight' => 0,
'settings' => [
'default_view_mode' => 'view_mode_1',
'allowed_view_modes' => [
'view_mode_1' => 'view_mode_1',
'view_mode_2' => 'view_mode_2',
],
'allowed_media_types' => [],
],
],
],
'expected_violations' => [],
];
$data['VALID: legacy format: filter_autop'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'bold',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_autop' => [
'id' => 'filter_autop',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [],
],
],
'expected_violations' => [],
];
$data['VALID: legacy HTML format: filter_autop + filter_url'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'bold',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_autop' => [
'id' => 'filter_autop',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [],
],
'filter_url' => [
'id' => 'filter_url',
'provider' => 'filter',
'status' => TRUE,
'weight' => -10,
'settings' => [
'filter_url_length' => 72,
],
],
],
'expected_violations' => [],
];
$data['VALID: legacy HTML format: filter_autop + filter_url (different order)'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'bold',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_autop' => [
'id' => 'filter_autop',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [],
],
'filter_url' => [
'id' => 'filter_url',
'provider' => 'filter',
'status' => TRUE,
'weight' => 10,
'settings' => [
'filter_url_length' => 72,
],
],
],
'expected_violations' => [],
];
$restricted_html_format_filters = Yaml::parseFile(__DIR__ . '/../../../../../profiles/standard/config/install/filter.format.restricted_html.yml')['filters'];
$data['INVALID: the default restricted_html text format'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => $restricted_html_format_filters,
'expected_violations' => [
'' => 'CKEditor 5 needs at least the <p> and <br> tags to be allowed to be able to function. They are not allowed by the "<em class="placeholder">Limit allowed HTML tags and correct faulty HTML</em>" (<em class="placeholder">filter_html</em>) filter.',
],
];
$data['INVALID: the modified restricted_html text format (with filter_autop and filter_url removed)'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => array_diff_key($restricted_html_format_filters, [
'filter_autop' => TRUE,
'filter_url' => TRUE,
]),
'expected_violations' => [
'' => 'CKEditor 5 needs at least the <p> and <br> tags to be allowed to be able to function. They are not allowed by the "<em class="placeholder">Limit allowed HTML tags and correct faulty HTML</em>" (<em class="placeholder">filter_html</em>) filter.',
],
];
$data['VALID: HTML format: empty toolbar + minimal allowed HTML'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => "<p> <br>",
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$data['VALID: HTML format: very minimal toolbar + minimal allowed HTML'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'bold',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => "<p> <br> <strong>",
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$data['INVALID: HTML format: empty toolbar + default allowed HTML tags + <p> + <br>'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>" . "<p> <br>",
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [
'filters.filter_html' => sprintf('The current CKEditor 5 build requires the following elements and attributes: <br><code>%s</code><br>The following elements are not supported: <br><code>%s</code>', Html::escape('<br> <p> <* dir="ltr rtl" lang>'), Html::escape('<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type="1 A I"> <li> <dl> <dt> <dd> <h2 id="jump-*"> <h3 id> <h4 id> <h5 id> <h6 id>')),
],
];
$data['INVALID: HTML format: empty toolbar + default allowed HTML tags'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => "<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>",
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [
'' => 'CKEditor 5 needs at least the <p> and <br> tags to be allowed to be able to function. They are not allowed by the "<em class="placeholder">Limit allowed HTML tags and correct faulty HTML</em>" (<em class="placeholder">filter_html</em>) filter.',
],
];
$data['INVALID Source Editable tag already provided by plugin and another available in a not enabled plugin'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'heading',
'bold',
'italic',
'link',
'sourceEditing',
'textPartLanguage',
],
],
'plugins' => [
'ckeditor5_heading' => [
'enabled_headings' => [
'heading2',
'heading3',
'heading4',
'heading5',
'heading6',
],
],
'ckeditor5_language' => [
'language_list' => 'un',
],
'ckeditor5_sourceEditing' => [
'allowed_tags' => [
// Tag-only; supported by enabled plugin.
'<strong>',
// Tag-only; supported by disabled plugin.
'<table>',
// Tag-only; supported by no plugin.
'<exotic>',
// Tag + attributes; all supported by enabled plugin.
'<span lang>',
// Tag + attributes; all supported by an ineligible disabled
// plugin (has no toolbar item, has conditions).
'<img src>',
// Tag + attributes; attributes supported by disabled plugin.
'<code class="language-*">',
// Tag + attributes; tag already supported by enabled plugin,
// attributes supported by disabled plugin
'<h2 class="text-align-center">',
// Tag + attributes; tag already supported by enabled plugin,
// attribute not supported by no plugin.
'<a hreflang>',
// Tag-only; supported by no plugin (only attributes on tag
// supported by a plugin).
'<span>',
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.0' => 'The following tag(s) are already supported by enabled plugins and should not be added to the Source Editing "Manually editable HTML tags" field: <em class="placeholder">Bold (<strong>)</em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.1' => 'The following tag(s) are already supported by available plugins and should not be added to the Source Editing "Manually editable HTML tags" field. Instead, enable the following plugins to support these tags: <em class="placeholder">Table (<table>)</em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.3' => 'The following attribute(s) are already supported by enabled plugins and should not be added to the Source Editing "Manually editable HTML tags" field: <em class="placeholder">Language (<span lang>)</em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.5' => 'The following attribute(s) are already supported by available plugins and should not be added to the Source Editing "Manually editable HTML tags" field. Instead, enable the following plugins to support these attributes: <em class="placeholder">Code Block (<code class="language-*">)</em>.',
// @todo "Style" should be removed from the suggestions in https://www.drupal.org/project/drupal/issues/3271179
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.6' => 'The following attribute(s) are already supported by available plugins and should not be added to the Source Editing "Manually editable HTML tags" field. Instead, enable the following plugins to support these attributes: <em class="placeholder">Style (<h2 class="text-align-center">), Alignment (<h2 class="text-align-center">)</em>.',
],
];
$data['INVALID some invalid Source Editable tags provided by plugin and another available in a not enabled plugin'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'heading',
'bold',
'italic',
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_heading' => [
'enabled_headings' => [
'heading2',
'heading3',
'heading4',
'heading5',
'heading6',
],
],
'ckeditor5_sourceEditing' => [
'allowed_tags' => [
'<aside>',
'<footer>',
'roy',
'<#donk>',
'<junior>cruft',
'',
' ',
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.2' => 'The following tag is not valid HTML: <em class="placeholder">roy</em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.3' => 'The following tag is not valid HTML: <em class="placeholder"><#donk></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.4' => 'The following tag is not valid HTML: <em class="placeholder"><junior>cruft</em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.5' => 'The following tag is not valid HTML: <em class="placeholder"></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.6' => 'The following tag is not valid HTML: <em class="placeholder"> </em>.',
],
];
$data['INVALID: drupalInsertImage without required dependent plugin configuration'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalInsertImage',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [
'settings.plugins.ckeditor5_imageResize' => 'Configuration for the enabled plugin "<em class="placeholder">Image resize</em>" (<em class="placeholder">ckeditor5_imageResize</em>) is missing.',
],
];
$data['VALID: drupalInsertImage toolbar item without image upload'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalInsertImage',
],
],
'plugins' => [
'ckeditor5_imageResize' => [
'allow_resize' => FALSE,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [],
];
$data['VALID: drupalInsertImage image upload enabled'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalInsertImage',
],
],
'plugins' => [
'ckeditor5_imageResize' => [
'allow_resize' => FALSE,
],
],
],
'editor_image_upload_settings' => [
'status' => TRUE,
'scheme' => 'public',
'directory' => 'inline-images',
'max_size' => NULL,
'max_dimensions' => [
'width' => NULL,
'height' => NULL,
],
],
'filters' => [],
'expected_violations' => [],
];
$data['INVALID: drupalMedia toolbar item condition NOT met: media filter disabled'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalMedia',
],
],
'plugins' => [],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [
'settings.toolbar.items.0' => 'The <em class="placeholder">Drupal media</em> toolbar item requires the <em class="placeholder">Embed media</em> filter to be enabled.',
],
];
$data['VALID: drupalMedia toolbar item condition met: media filter enabled'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'drupalMedia',
],
],
'plugins' => [
'media_media' => [
'allow_view_mode_override' => FALSE,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'media_embed' => [
'id' => 'media_embed',
'provider' => 'media',
'status' => TRUE,
'weight' => 0,
'settings' => [
'default_view_mode' => 'default',
'allowed_view_modes' => [],
'allowed_media_types' => [],
],
],
],
'expected_violations' => [],
];
$data['VALID: HTML format: very minimal toolbar + wildcard in source editing HTML'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'bold',
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_sourceEditing' => [
'allowed_tags' => [
'<$text-container data-llama>',
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p data-llama> <br> <strong>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$self_xss_source_editing = [
// Dangerous attribute with all values allowed.
'<p onhover>',
'<img on*>',
'<blockquote style>',
// No danger.
'<marquee>',
// Dangerous attribute with some values allowed.
'<a onclick="javascript:*">',
'<code style="foo: bar;">',
// Also works on wildcard tags.
'<$text-container style>',
];
$data['INVALID: SourceEditing plugin configuration: self-XSS detected when using filter_html'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_sourceEditing' => [
'allowed_tags' => $self_xss_source_editing,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p onhover style> <br> <img on*> <blockquote style> <marquee> <a onclick="javascript:*"> <code style="foo: bar;">',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [
'filters.filter_html' => 'The current CKEditor 5 build requires the following elements and attributes: <br><code><br> <p onhover style> <* dir="ltr rtl" lang> <img on*> <blockquote style> <marquee> <a onclick="javascript:*"> <code style="foo: bar;"></code><br>The following elements are missing: <br><code><p onhover style> <img on*> <blockquote style> <code style="foo: bar;"></code>',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.0' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><p onhover></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.1' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><img on*></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.2' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><blockquote style></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.4' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><a onclick="javascript:*"></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.5' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><code style="foo: bar;"></em>.',
'settings.plugins.ckeditor5_sourceEditing.allowed_tags.6' => 'The following tag in the Source Editing "Manually editable HTML tags" field is a security risk: <em class="placeholder"><$text-container style></em>.',
],
];
$data['VALID: SourceEditing plugin configuration: self-XSS not detected when not using filter_html'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_sourceEditing' => [
'allowed_tags' => $self_xss_source_editing,
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [],
'expected_violations' => [],
];
$data['INVALID: Style plugin configured to add class to unsupported tag'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'style',
],
],
'plugins' => [
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Highlighted',
'element' => '<blockquote class="highlighted">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p> <br> <blockquote class="highlighted">',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [
'settings.plugins.ckeditor5_style' => 'The <em class="placeholder">Style</em> plugin needs another plugin to create <code><blockquote></code>, for it to be able to create the following attributes: <code><blockquote class="highlighted"></code>. Enable a plugin that supports creating this tag. If none exists, you can configure the Source Editing plugin to support it.',
],
];
$data['INVALID: Style plugin configured to add class already added by an other plugin'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'alignment',
'style',
],
],
'plugins' => [
'ckeditor5_alignment' => [
'enabled_alignments' => [
'justify',
],
],
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Text align',
'element' => '<p class="text-align-justify">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p class="text-align-justify"> <br>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [
'settings.plugins.ckeditor5_style.styles.0.element' => 'A style must only specify classes not supported by other plugins. The <code>text-align-justify</code> classes on <code><p></code> are already supported by the enabled <em class="placeholder">Alignment</em> plugin.',
],
];
$data['VALID: Style plugin configured to add new class to an already restricted tag'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'alignment',
'style',
],
],
'plugins' => [
'ckeditor5_alignment' => [
'enabled_alignments' => [
'justify',
],
],
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Add baguette class',
'element' => '<p class="baguette">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p class="text-align-justify baguette"> <br>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$data['VALID: Style plugin configured to add class to an element provided by an explicit plugin that already allows all classes'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'kbdAllClasses',
'style',
],
],
'plugins' => [
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Add baguette class',
'element' => '<kbd class="baguette">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p> <br> <kbd class>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$data['VALID: Style plugin configured to add class to GHS-supported HTML5 tag'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'style',
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_sourceEditing' => [
'allowed_tags' => [
'<kbd>',
],
],
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Add baguette class',
'element' => '<kbd class="baguette">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p> <br> <kbd class="baguette">',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
$data['VALID: Style plugin configured to add class to GHS-supported HTML5 tag that already allows all classes'] = [
'ckeditor5_settings' => [
'toolbar' => [
'items' => [
'style',
'sourceEditing',
],
],
'plugins' => [
'ckeditor5_sourceEditing' => [
'allowed_tags' => [
'<bdi class>',
],
],
'ckeditor5_style' => [
'styles' => [
[
'label' => 'Bidirectional name',
'element' => '<bdi class="name">',
],
],
],
],
],
'editor_image_upload_settings' => [
'status' => FALSE,
],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => 0,
'settings' => [
'allowed_html' => '<p> <br> <bdi class>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => TRUE,
],
],
],
'expected_violations' => [],
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.