diff --git a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php index 4fbead9..3de3c25 100644 --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php +++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php @@ -49,7 +49,22 @@ protected function setUp() { 'filter_html' => [ 'status' => 1, 'settings' => [ - 'allowed_html' => '
',
+ 'allowed_html' => [
+ 'h2' => [
+ 'id' => '*',
+ ],
+ 'h3' => [],
+ 'h4' => [],
+ 'h5' => [],
+ 'h6' => [],
+ 'p' => [],
+ 'br' => [],
+ 'strong' => [],
+ 'a' => [
+ 'href' => '*',
+ 'hreflang' => '*',
+ ],
+ ],
]
],
],
@@ -118,7 +133,18 @@ public function testGetJSSettings() {
// Change the allowed HTML tags; the "allowedContent" and "format_tags"
// settings for CKEditor should automatically be updated as well.
$format = $editor->getFilterFormat();
- $format->filters('filter_html')->settings['allowed_html'] .= '
';
+ $format->filters('filter_html')->settings['allowed_html'] += [
+ 'pre' => [
+ 'class' => '*',
+ ],
+ 'h1' => [],
+ 'blockquote' => [
+ 'class' => '*',
+ ],
+ 'address' => [
+ 'class' => 'foo bar-* *',
+ ],
+ ];
$format->save();
$expected_config['allowedContent']['pre'] = ['attributes' => 'class', 'styles' => FALSE, 'classes' => TRUE];
diff --git a/core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php b/core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php
index aecc228..87f8dc4 100644
--- a/core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php
+++ b/core/modules/ckeditor/tests/src/Kernel/Plugin/CKEditorPlugin/InternalTest.php
@@ -115,7 +115,10 @@ public function formatTagsSettingsTestCases() {
'filter_html' => [
'status' => 1,
'settings' => [
- 'allowed_html' => '
',
+ 'allowed_html' => [
+ 'h1' => [],
+ 'h2' => [],
+ ],
'filter_html_help' => 1,
'filter_html_nofollow' => 0,
],
diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php
index d00fe0e..f1991d9 100644
--- a/core/modules/editor/src/Tests/EditorSecurityTest.php
+++ b/core/modules/editor/src/Tests/EditorSecurityTest.php
@@ -92,7 +92,17 @@ protected function setUp() {
'filter_html' => [
'status' => 1,
'settings' => [
- 'allowed_html' => '
',
+ 'allowed_html' => [
+ 'h2' => [],
+ 'h3' => [],
+ 'h4' => [],
+ 'h5' => [],
+ 'h6' => [],
+ 'p' => [],
+ 'br' => [],
+ 'strong' => [],
+ 'a' => [],
+ ],
]
],
],
@@ -107,7 +117,17 @@ protected function setUp() {
'filter_html' => [
'status' => 1,
'settings' => [
- 'allowed_html' => '