core/modules/ckeditor5/ckeditor5.ckeditor5.yml | 46 ++++++++++++++++++++++ .../src/Kernel/CKEditor5PluginManagerTest.php | 4 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/core/modules/ckeditor5/ckeditor5.ckeditor5.yml b/core/modules/ckeditor5/ckeditor5.ckeditor5.yml index 05d0031750..4101ef611c 100644 --- a/core/modules/ckeditor5/ckeditor5.ckeditor5.yml +++ b/core/modules/ckeditor5/ckeditor5.ckeditor5.yml @@ -93,6 +93,52 @@ ckeditor5_wildcardHtmlSupport: # @see \Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface::getEnabledDefinitions() conditions: [] +# https://html.spec.whatwg.org/multipage/dom.html#attr-dir +ckeditor5_globalAttributeDir: + ckeditor5: + plugins: [htmlSupport.GeneralHtmlSupport] + config: + htmlSupport: + allow: + - + name: + regexp: + pattern: /.*/ + attributes: + - key: dir + value: + regexp: + pattern: /^(ltr|rtl)$/ + drupal: + label: Global `dir` attribute + # @see \Drupal\filter\Plugin\Filter\FilterHtml::getHTMLRestrictions() + elements: + - <* dir="ltr rtl"> + library: core/ckeditor5.htmlSupport + conditions: + filter: filter_html + +# https://html.spec.whatwg.org/multipage/dom.html#attr-lang +ckeditor5_globalAttributeLang: + ckeditor5: + plugins: [htmlSupport.GeneralHtmlSupport] + config: + htmlSupport: + allow: + - + name: + regexp: + pattern: /.*/ + attributes: lang + drupal: + label: Global `lang` attribute + # @see \Drupal\filter\Plugin\Filter\FilterHtml::getHTMLRestrictions() + elements: + - <* lang> + library: core/ckeditor5.htmlSupport + conditions: + filter: filter_html + ckeditor5_specialCharacters: ckeditor5: plugins: diff --git a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php index d9b24457f8..14ae41cb6e 100644 --- a/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php +++ b/core/modules/ckeditor5/tests/src/Kernel/CKEditor5PluginManagerTest.php @@ -1020,6 +1020,8 @@ public function testEnabledPlugins() { 'ckeditor5_bold', 'ckeditor5_emphasis', 'ckeditor5_essentials', + 'ckeditor5_globalAttributeDir', + 'ckeditor5_globalAttributeLang', 'ckeditor5_heading', 'ckeditor5_paragraph', 'ckeditor5_pasteFromOffice', @@ -1030,6 +1032,7 @@ public function testEnabledPlugins() { 'ckeditor5/drupal.ckeditor5.emphasis', 'ckeditor5/drupal.ckeditor5.internal', 'core/ckeditor5.basic', + 'core/ckeditor5.htmlSupport', 'core/ckeditor5.internal', 'core/ckeditor5.pasteFromOffice', ]; @@ -1126,7 +1129,6 @@ public function testEnabledPlugins() { $this->assertSame(array_values($expected_plugins), $plugin_ids); $expected_libraries = array_merge($expected_libraries, [ 'core/ckeditor5.alignment', - 'core/ckeditor5.htmlSupport', ]); sort($expected_libraries); $this->assertSame($expected_libraries, $this->manager->getEnabledLibraries($editor));