Problem/Motivation
In the field help settings for the "Manually editable HTML tags," it says this:
A list of HTML tags that can be used while editing source. It is only necessary to add tags that are not already supported by other enabled plugins. For example, if "Bold" is enabled, it is not necessary to add the
<strong>tag, but it may be necessary to add<dl><dt><dd>in a format that does not have a definition list plugin, but requires definition list markup.
In the Text Format settings, I've added <style> and <script> as "Manually editable HTML tags," but the editor is not behaving the way I would expect. When I paste in some HTML from the old CKEditor into CKEditor 5, it's still stripping out those tags, even though I've explicitly defined them in this field as being allowed.
Steps to reproduce
1. Install CKEditor 5 module.
2. Create a Text Format that uses CKEditor 5.
3. Under "Source Editing" -> "Manually editable HTML tags" field, add <style> and <script> to the list of manually editable tags. Save the configuration.
4. In the actual editor, go into the HTML source view, and paste in some HTML that contains the <style> or <script> tag.
5. Switch the editor to the preview view.
6. Switch back to the HTML source view. Examine the HTML.
Expected: <style> and <script> tags should still show up in the HTML.
Actual: <style> and <script> tags have been stripped from the HTML.
Proposed resolution
Fix the bug that is preventing HTML tags from being rendered when they are specifically included in the "Manually editable HTML tags" field.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot from 2021-12-31 15-04-16.png | 21.6 KB | j2 |
Comments
Comment #2
wim leersWow, that is definitely an interesting/unexpected way to use this — although you're totally right that nothing signals that today! Digging into this…
Thanks for the (interesting! :D) bug report 🙏
Comment #3
wim leersReproduced.
First: scripts —
<script>Paste this:
CKEditor 5 automatically converts this to
… even in the text format 🤯 Ah, but wait, this is exactly the bug that #3245950: [upstream] <script> tag support in GHS reported.
Second: styles —
<style>Paste this:
CKEditor 5 automatically converts this to
… even in the text format 🤯
This is a new discovery.
Comment #4
wim leersI will bring this up in the next meeting we have with CKE5 developers. 👍
Comment #5
wim leersReported: https://github.com/ckeditor/ckeditor5/issues/11104
Comment #6
wim leersDiscussed in CKE5 meeting: https://docs.google.com/document/d/1R0WI9eKt7vug79HrlEwI5BHfmdTgM1KJrjB6...
They'll work on adding support for this; should be simple, should be similar to what they did for
<script>support in GHS.Comment #7
wim leersComment #8
j2@Wim Leers: Awesome! Thank you!
Comment #9
wim leersComment #10
wim leersSee #3269064-6: Update to CKEditor 5 v33.0.0.