- Issue created by @2dareis2do
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Note that the current description doesn't mention attributes at all, only tags. So retitling slightly, but the scope remains the same ๐
- ๐ฌ๐งUnited Kingdom 2dareis2do
Ok I have created a patch that updates this. Primarily it mentions a mention of attributes and also strip html filter relationship
- last update
over 1 year ago Composer error. Unable to continue. - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 30,764 pass - Status changed to Needs work
over 1 year ago 8:08pm 15 December 2023 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Thanks for getting this going! ๐
Unfortunately, the current proposal will never be able to land in Drupal core ๐
It's tightly coupling this functionality to
filter_html
(even though it is not tightly coupled) and explicitly mentioning the Standard install profile's text format, which is even more of a no-go.This must be phrased in a way that is accurate without referring to those other concepts, because neither of them may be in use on this text format or site!
- ๐ฌ๐งUnited Kingdom 2dareis2do
Ok, I can easily remove reference to the install profile and the Basic HTML text format. Certainly it may not be being used, but it will be part of the codebase and also provides some example config (as you pointed out to me previously), so at he time I thought it worth mentioning here.
.
I am a bit confused about your comment regarding filter_html. I have assumed it is enabled, which you correctly point out is not necessarily the case. If it is not enabled though, what is the benefit of adding tags and attributes here? In what sense are they decoupled?Perhaps I can just modify to say if "Limit allowed HTML tags and correct faulty HTML" filter is enabled ?
- ๐ฌ๐งUnited Kingdom 2dareis2do
Here is another attempt to improve or refine the ckeditor 5 UX around this. I have also revised the filter copy that is found in ckeditor5.module, specifically
$filter_allowed_html['#description']
. I think this makes sense from a developer/site builder perspective. Unfortunately this change is a little polluted due to changes required to satisfy phpcs requirements e.g.phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/core/modules/ckeditor5/ckeditor5.module
- last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Composer error. Unable to continue. - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 29,722 pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - ๐ฌ๐งUnited Kingdom 2dareis2do
Refined copy as I now realise source plugin may not be enabled.
What's interesting here is that enabling and disabling resets any values here so this could also explain why this could be empty.
- last update
over 1 year ago 29,722 pass - last update
over 1 year ago 29,722 pass - ๐ฌ๐งUnited Kingdom 2dareis2do
Looks like in php stan 10.10 adds support for not throwing an error when using function_exists
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Thanks for pushing this forward, @2dareis2do! It seems that most of the ~17.5 KB of changes are out-of-scope code reformatting/renaming. Can you please remove that from the patch? ๐
-
+++ b/core/modules/ckeditor5/ckeditor5.module @@ -177,14 +202,14 @@ function ckeditor5_form_filter_format_form_alter(array &$form, FormStateInterfac - if (!function_exists('_add_ajax_listeners_to_plugin_inputs')) { + if (!function_exists('ckeditor5__add_ajax_listeners_to_plugin_inputs')) { /** * Recursively adds AJAX listeners to plugin settings elements. @@ -196,7 +221,7 @@ function ckeditor5_form_filter_format_form_alter(array &$form, FormStateInterfac @@ -196,7 +221,7 @@ function ckeditor5_form_filter_format_form_alter(array &$form, FormStateInterfac * @param array $plugins_config_form * The plugins config subform render array. */ - function _add_ajax_listeners_to_plugin_inputs(array &$plugins_config_form): void { + function ckeditor5__add_ajax_listeners_to_plugin_inputs(array &$plugins_config_form): void {
These changes are out of scope?
-
+++ b/core/modules/ckeditor5/ckeditor5.module @@ -222,14 +247,20 @@ function _add_ajax_listeners_to_plugin_inputs(array &$plugins_config_form): void - $form['#after_build'][] = [CKEditor5::class, 'assessActiveTextEditorAfterBuild']; - $form['#validate'][] = [CKEditor5::class, 'validateSwitchingToCKEditor5']; + $form['#after_build'][] = [ + CKEditor5::class, + 'assessActiveTextEditorAfterBuild', + ]; + $form['#validate'][] = [ + CKEditor5::class, + 'validateSwitchingToCKEditor5', + ];
This is reformatting code without changing any logic โ such changes are out of scope.
-
+++ b/core/modules/ckeditor5/ckeditor5.module @@ -238,8 +269,12 @@ function _add_ajax_listeners_to_plugin_inputs(array &$plugins_config_form): void - $manually_editable_tags = $form_state->getValue(['editor', 'settings', 'plugins', 'ckeditor5_sourceEditing', 'allowed_tags']); - $styles = $form_state->getValue(['editor', 'settings', 'plugins', 'ckeditor5_style', 'styles']); + $manually_editable_tags = $form_state->getValue( + ['editor', 'settings', 'plugins', 'ckeditor5_sourceEditing', 'allowed_tags'] + ); + $styles = $form_state->getValue( + ['editor', 'settings', 'plugins', 'ckeditor5_style', 'styles'] + ); if ($limit_allowed_html_tags && is_array($manually_editable_tags) || is_array($styles)) {
This is reformatting code without changing any logic โ such changes are out of scope.
-
- last update
about 1 year ago 29,722 pass - ๐ฌ๐งUnited Kingdom 2dareis2do
patch updated to remove scope creep.
I don't really like doing that but was trying to avoid the tests from not completing. Will try again without.
drupal_projects_issues_3408421f_new.patch applied and working for me locally using composer patches.
- ๐ฆ๐บAustralia mingsong ๐ฆ๐บ
Wildcard is handy in a situation where there are a lots of attributes needed to be allowed, that are not supported by enabled plugins.