$this->messenger()->addMessage($this->t('Check <a href=":handbook">this handbook page</a> for details about compatibility issues of contrib modules.',[
@@ -141,27 +142,27 @@ public function computeSmartDefaultSettings(?EditorInterface $text_editor, Filte
$unsupported=$missing->diff($missing_attributes);
if($enabling_message_content){
$messages[]=$this->t('The following plugins were enabled to support tags that are allowed by this text format: %enabling_message_content.',
$messages[MessengerInterface::TYPE_STATUS][]=$this->t('The following plugins were enabled to support tags that are allowed by this text format: %enabling_message_content.',
$messages[]=$this->t("The following tags were permitted by this format's filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin's <em>Manually editable HTML tags</em>: @unsupported_string.",[
$messages[MessengerInterface::TYPE_STATUS][]=$this->t("The following tags were permitted by this format's filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin's <em>Manually editable HTML tags</em>: @unsupported_string.",[
$messages[]=$this->t('The following plugins were enabled to support specific attributes that are allowed by this text format: %enabled_for_attributes_message_content.',
$messages[MessengerInterface::TYPE_STATUS][]=$this->t('The following plugins were enabled to support specific attributes that are allowed by this text format: %enabled_for_attributes_message_content.',
$messages[]=$this->t("This format's HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin's <em>Manually editable HTML tags</em>: @missing_attributes.",[
$messages[MessengerInterface::TYPE_STATUS][]=$this->t("This format's HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin's <em>Manually editable HTML tags</em>: @missing_attributes.",[
$messages[]=$this->t('The <em>Source Editing</em> plugin was enabled to support tags and/or attributes that are not explicitly supported by any available CKEditor 5 plugins.');
$messages[MessengerInterface::TYPE_STATUS][]=$this->t('The <em>Source Editing</em> plugin was enabled to support tags and/or attributes that are not explicitly supported by any available CKEditor 5 plugins.');
$messages[]=$this->t('The CKEditor 4 button %button does not have a known upgrade path. If it allowed editing markup, then you can do so now through the Source Editing functionality.',[
$messages[MessengerInterface::TYPE_WARNING][]=$this->t('The CKEditor 4 button %button does not have a known upgrade path. If it allowed editing markup, then you can do so now through the Source Editing functionality.',[
'%button'=>$cke4_button,
]);
continue;
@@ -270,7 +271,7 @@ private function createSettingsFromCKEditor4(array $ckeditor4_settings, array $e
$settings['plugins']+=$cke5_plugin_settings;
}
catch(\OutOfBoundsException$e){
$messages[]=$this->t('The %cke4_plugin_id plugin settings do not have a known upgrade path.',[
$messages[MessengerInterface::TYPE_WARNING][]=$this->t('The %cke4_plugin_id plugin settings do not have a known upgrade path.',[
'%cke4_plugin_id'=>$cke4_plugin_id,
]);
continue;
@@ -762,7 +763,7 @@ private function computeSubsetSettingForEnabledPluginsWithSubsets(EditorInterfac
$messages[]=$this->t('The CKEditor 5 plugin %button has a configurable subset of elements, but does not have a known upgrade path to configure that subset to match your text format. Hence it is now using its default configuration.',[
$messages[MessengerInterface::TYPE_WARNING][]=$this->t('The CKEditor 5 plugin %button has a configurable subset of elements, but does not have a known upgrade path to configure that subset to match your text format. Hence it is now using its default configuration.',[
'The following plugins were enabled to support tags that are allowed by this text format: <em class="placeholder">Code (for tags: <code>) Language (for tags: <span>)</em>.',
'The following tags were permitted by this format\'s filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <cite> <dl> <dt> <dd>.',
],
],
];
yield"basic_html can be switched to CKEditor 5 without problems (3 upgrade messages)"=>NestedArray::mergeDeep(
$basic_html_test_case,
[
'expected_messages'=>[
'status'=>[
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.',
],
],
]
);
@@ -514,8 +522,10 @@ public function provider() {
],
],
'expected_messages'=>[
'status'=>[
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img data-caption>.',
],
],
]);
yield"basic_html with filter_align removed => disallows <img data-align> => supported through sourceEditing (3 upgrade messages) "=>NestedArray::mergeDeep(
@@ -534,8 +544,10 @@ public function provider() {
],
],
'expected_messages'=>[
'status'=>[
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img data-align>.',
],
],
]);
yield"basic_html_without_h4_h6 can be switched to CKEditor 5 without problems, heading configuration computed automatically"=>[
@@ -563,10 +575,11 @@ public function provider() {
['This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h5 id>.'],
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h5 id>.',
],
]),
];
yield"basic_html_with_h1 can be switched to CKEditor 5 without problems, heading configuration computed automatically"=>[
@@ -594,10 +607,11 @@ public function provider() {
['This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.'],
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.',
],
]),
];
yield"basic_html_without_headings can be switched to CKEditor 5 without problems, heading configuration computed automatically"=>[
@@ -623,10 +637,11 @@ public function provider() {
['This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type>.'],
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type>.',
],
]),
];
yield"basic_html_with_pre can be switched to CKEditor 5 without problems, heading configuration computed automatically"=>[
@@ -644,10 +659,12 @@ public function provider() {
'The following plugins were enabled to support tags that are allowed by this text format: <em class="placeholder">Code (for tags: <code>) Language (for tags: <span>) Code Block (for tags: <pre>)</em>.',
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.',
],
],
];
yield"basic_html_with_alignable_p can be switched to CKEditor 5 without problems, align buttons added automatically"=>[
@@ -682,11 +699,11 @@ public function provider() {
'The following plugins were enabled to support specific attributes that are allowed by this text format: <em class="placeholder">Align center ( for tag: <p> to support: class with value(s): text-align-center), Justify ( for tag: <p> to support: class with value(s): text-align-justify)</em>.',
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.',
],
]),
];
@@ -706,8 +723,10 @@ public function provider() {
// @todo: Remove data-view-mode in https://www.drupal.org/project/drupal/issues/3269657.
"This format's HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin's <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.",
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img data-*>.',
],
]),
];
@@ -793,10 +813,15 @@ public function provider() {
''=>'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.',
],
'expected_messages'=>[
'status'=>[
'The following plugins were enabled to support tags that are allowed by this text format: <em class="placeholder">Link (for tags: <a>) Block quote (for tags: <blockquote>) Code (for tags: <code>) List (for tags: <ul><ol><li>)</em>.',
'The following tags were permitted by this format\'s filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <cite> <dl> <dt> <dd>.',
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>.',
''=>'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.',
],
];
yield"full_html can be switched to CKEditor 5 (no upgrade messages)"=>[
@@ -905,10 +930,12 @@ public function provider() {
''=>'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.',
],
'expected_messages'=>[
'status'=>[
'The following plugins were enabled to support tags that are allowed by this text format: <em class="placeholder">Link (for tags: <a>) Block quote (for tags: <blockquote>) Code (for tags: <code>) List (for tags: <ul><ol><li>)</em>.',
'The following tags were permitted by this format\'s filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <cite> <dl> <dt> <dd>.',
'This format\'s HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin\'s <em>Manually editable HTML tags</em>: <a hreflang> <blockquote cite> <ul type> <ol start type="1 A I"> <h2 id="jump-*"> <h3 id> <h4 id> <h5 id> <h6 id>.',
],
],
];
yield"cke4_plugins_with_settings can be switched to CKEditor 5 without problems, settings are upgraded too"=>[
'The CKEditor 4 button <em class="placeholder">Llama</em> does not have a known upgrade path. If it allowed editing markup, then you can do so now through the Source Editing functionality.',
'The <em class="placeholder">llama_contextual_and_button</em> plugin settings do not have a known upgrade path.',
],
],
];
yield"cke4_plugins_with_settings_for_disabled_plugins can be switched to CKEditor 5 without problems; irrelevant settings are dropped"=>[