Closed itsmattsoria closed 1 year ago
Hi, thanks for reaching out. This seems to be related to: https://github.com/ezyang/htmlpurifier/issues/302. CKEditor 5 uses oembed
to add media (CKEditor 4 used iframe, which is why it worked there). We’ll talk about options internally, and I’ll let you know once we’ve done so.
@i-just Ahh, yep. Dang. Well thank you for that update, I appreciate it!
Craft 3.7.66 and 4.3.9 are out with an update to the HTML Purifier config to allow oembed
tags (via craftcms/cms#12675). There’s also a new Embedding Videos/Media in CKEditor 5 section in the plugin readme.
We're on Craft 4.5.5 but YouTube video's are always stripped out when using HTML purifier, regardless of what config is used.
4.5.9 also not working unless uncheck the Purify HTML option in the field.
"HTML.SafeIframe": true,
"URI.SafeIframeRegexp": "%^(https?:)?//(www\\.youtube\\.com/embed/|www\\.youtube\\.com/watch\\?v=.+|youtu\\.be/.+|www\\.youtube(?:-nocookie)?\\.com/embed/|player\\.vimeo\\.com/video/)%"
Add this to your htmlpurifier json config @FrDH and try again
Description
The
Default.json
config for HTML Purifier that is included on installation has the following lines, which should prevent YouTube and Vimeo video embeds from being stripped out of a CKEditor field on save, but embeds from either platform are still being stripped out.I wasn't totally sure if this issue belongs here, or in the Craft starter, or with HTML Purifier itself, but for reference, I tested this with Redactor, and it wasn't an issue there, the embeds remained after save.
Steps to reproduce
ddev composer require craftcms/ckeditor -w && ddev exec php craft plugin/install ckeditor
https://cdn.ckeditor.com/ckeditor5/32.0.0/classic/ckeditor.js
as the CKEditor Build URL.Default
config.Additional info