- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
drush cex <the ID of your text format>
+drush cex <the ID of your text editor>
- 🇦🇲Armenia le72 Yerevan 🇦🇲
With enabled "Limit allowed HTML tags and correct faulty HTML" filter you can't have style attribute.
- 🇧🇪Belgium svdhout
We use the style plugin to add inline styles, like this:
span.highlight|Highlight
Saving the editor configuration throws the following error
The Style plugin needs another plugin to create <span>, for it to be able to create the following attributes: <span class="highlight">. Enable a plugin that supports creating this tag. If none exists, you can configure the Source Editing plugin to support it.
Which is correct, because we do not have a plugin defining that we can use span tags.
The approach for adding the source editing plugin works, and allows me to add the styling i want.However, i do not really like having to add the Source editing plugin for this.
I can solve the problem in a module by adding this configuration inside a .ckeditor5.yml file:
ckeditor5_span_span: ckeditor5: plugins: - essentials.Essentials drupal: label: Span library: core/ckeditor5.essentials admin_library: ckeditor5/internal.admin.essentials elements: - <span>
Is allowing span tags something we want to do in core, or would it be best to create a contrib module for this?
- Status changed to Fixed
over 1 year ago 11:40am 23 March 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
However, i do not really like having to add the Source editing plugin for this.
That's the only way, sorry.
I can solve the problem in a module by adding this configuration inside a .ckeditor5.yml file:
[…]Is allowing span tags something we want to do in core
Clever work-around for your particular use case! 😄 But that now means you can create
<span>
tags using the UI. Which is not actually true.In fact, most people seem to be really annoyed by
<span>
in general — we used to be more pragmatic but got a lot of backlash. See #3273983: Do not assume that plugin supportingalso supports → .in SourceEditingRedundantTags and upgrade path or would it be best to create a contrib module for this?
I think an
ckeditor5_implicitly_allow_spans
contrib module would make sense, yes! Automatically closed - issue fixed for 2 weeks with no activity.