0

programmers!

I am using ckeditor5 with strapi. But I could not figure out how to embed codepens. When I put recommended embed code by codepen itself, it just shows : See pen <a href="..."/>. If i inject the code with iframe it is just disappearing.

Anyone has ever done it ?

Ali
  • 15
  • 4

1 Answers1

0

CKEditor plugin for Strapi allows to embed HTML snippets. See screenshot.

If the iframe code is visible in your Strapi dashboard, but it doesn't appear on your website (e.g. React app), it might be because of HTML Sanitization.

If your app uses something like DOMPurify, check How to allow an iframe tag in dompurify including all of its attributes.


If you don't need to stick to CKEditor, I recommend using Editor.js which has a plugin that offers a sanitized way to embed various services, such as CodePen. It's bundled by default with the Editor.js plugin for Strapi.

konhi
  • 11
  • 1