How do I change the embed media properties (size, text wrapping, border, and so on) in CKEditor 5 (checking for script tag)?

Volk Volk 571 Reputation points
2024-05-08T13:14:56.79+00:00

Hi!

I have an implementation of CKEditor fields in my project in the form:

DecoupledEditor
            .create( document.querySelector( '#editor' ), {
                extraPlugins: [ MyCustomUploadAdapterPlugin ],
                removePlugins: [ 'Heading' ]
            } )
            .then( editor => {
                const toolbarContainer = document.querySelector( '#editor-toolbar-container' );
                toolbarContainer.appendChild( editor.ui.view.toolbar.element );

ToolBar

I can insert media embed, but I can't format them in any way - I can't change their size, text wrapping, border, and so on. Media embed: https://ckeditor.com/docs/ckeditor5/latest/features/media-embed.html

I need to add some buttons (and/or plugins) to the standard set of buttons (in the toolbar) (perhaps an IFrame or Media embed toolbar) so that the user can format the media embed without using the code.

But if you still can't do without inserting a block of code <iframe> (using the Source button), then do I need to secure Net.Core server by checking the text for the <script> tag before writing it to the database?

Tell me, how do I realize this in DecoupledEditor?

There is some kind of IFrame Dialog (It is unclear whether it will be suitable for my purposes).

https://ckeditor.com/cke4/addon/iframe

https://www.drupal.org/project/ckeditor_iframe

Here you can put an IFrame with a code, but you can't change anything except the size:

Feature-rich editor

https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-featured-editor.html

I just need to change the media embed properties somehow.

AsInImageElement

How can I do this better?

Thanks!

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,254 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
906 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Volk Volk 571 Reputation points
    2024-05-18T12:11:44.0766667+00:00

    Everything was solved with CKEditor technical support. The quesiton is closed.

    0 comments No comments