mostafaznv / nova-ckeditor

CkEditor 5 Field for Laravel Nova with Media & Snippet Browsers
https://mostafaznv.gitbook.io/nova-ckeditor/
MIT License
50 stars 21 forks source link

Passing options to mediaEmbed #39

Closed wildyeast closed 1 year ago

wildyeast commented 1 year ago

Hey,

I would like to add additional providers to the mediaEmbed plugin as described in https://ckeditor.com/docs/ckeditor5/latest/features/media-embed.html

This is the example from the website:

        mediaEmbed: {
            providers: [
                {
                    // A URL regexp or an array of URL regexps:
                    url: /^example\.com\/media\/(\w+)/,

                    // To be defined only if the media are previewable:
                    html: match => '...'
                },
                ...
            ]
        }

This is what I am trying to do in config/nova-ckeditor.php:

 'options' => [
            'mediaEmbed' => [
              /*
                'providers' => [
                    'url' => '/^example\.com\/media\/(\w+)/',
                ]
              */
            ],
  ...

This causes the editor to crash, e.g. not to be displayed in the Nova field.

  1. Do you know how to correctly define additional providers?
  2. How can I debug editor crashes? There is no related output in the console.
  3. How would I write the match function from the example?

Thank you for creating this package!

mostafaznv commented 1 year ago

Hi @wildyeast Thanks for your report.

Please update the package to v3.4.0

More information: https://github.com/mostafaznv/nova-ckeditor#media-embed