At some point it looks like core's CKEditor switched to using iframes by default. This means that when the add_css AJAX command runs, the additional CSS gets added to the root document's head, and not the CKEditor iframe's head, so the styles don't actually load in the editor.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3097116-provide-plain-html-preview.patch | 3.6 KB | dave reid |
| #4 | 3097116-provide-plain-html-preview.patch | 3.14 KB | dave reid |
Comments
Comment #2
dave reidIt doesn't seem possible to add CSS to the WYSIWYG dynamically from the plugin JS. It does look like this would be possible with CKEditor.editor.addContentsCss(), which is available as of v4.4+, but with D8 we're only using 4.11.4 as the latest version. :(
Comment #3
dave reidComment #4
dave reidFor now let's provide a simpler preview if the request is a normal GET request.
Comment #5
dave reidComment #6
dave reidTry to fix the test
Comment #8
dave reidMarking back to needs work for now.
Comment #9
dave reidI wonder if this is worth revisiting to see if we could also solve this for JS assets as well with https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_scriptLoader.html