How to enable CKEditor's mediaEmbed.previewsInData property in Strapi

System Information
  • Strapi Version: 3.2.5
  • Operating System: Windows
  • Database: SQLite3
  • Node Version: 12.20.0
  • NPM Version:
  • Yarn Version: 1.22.10

Hi everybody,
By replacing the default editor in Strapi with the CKEditor5, I was able to import html instead of markdown into my gatsby.js project.
Now adding a YouTube video in my RichText fields is possible and they are displayed correct in the strapi/admin backend.
While fetching the data in gatsby.js the nicely displayed YouTube video from Strapi/admin gets reduced to an <oembed url="...">.

As per the documentation of CKEditor Media-Embed

this is the correct default behavior.

There is a workaround though:

Optionally, by setting mediaEmbed.previewsInData to true you can configure the media embed feature to output media in the same way they look in the editor. So if the media element is “previewable”, the media preview (HTML) is saved to the database:

How and where can I set this property?

Thanks for your help.
JK

1 Like

Hi @JohnnyKrup, have you found an answer for that? I am having the same issue as you currently…

1 Like

You can do it like so:

in config/plugins.js

  ckeditor: {
    enabled: true,
    config: {
      editor: {
        mediaEmbed: {
          previewsInData: true
        }
      }
    }
  }

Any idea how to set this up for the ck editor custome field plugin?

i tried this:

  ckeditor5: {
    enabled: true,
    config: {
      editor: {
        mediaEmbed: {
          previewsInData: true
        }
      }
    }
  }

but it ain’t working

This is not working…

Is there any solution available for that problem? The above answers doesnt work for me as well.