SKLINET / strapi-plugin-tinymce

11 stars 18 forks source link

Some plugins cannot load #6

Closed Drillan767 closed 2 years ago

Drillan767 commented 2 years ago

Hello (again)!

I've set my configuration as follows:

tinymce: {
    enabled: true,
    config: {
        editor: {
            outputFormat: 'html',
            editorConfig: {
                menubar: false,
                forced_root_block: '',
                extended_valid_elements: 'span, img, div, section',
                plugins: [
                    "advlist autolink lists link image charmap print preview anchor",
                    "searchreplace visualblocks code fullscreen",
                    "table nonbreaking",
                    "insertdatetime media table paste code wordcount",
                ],
                toolbar:
                    "undo redo | styleselect | bold italic forecolor backcolor | \
                    alignleft aligncenter alignright alignjustify | \
                    table visualblocks |\
                    nonbreaking bullist numlist | removeformat code",
            }
        }
    }
}, 

So, excepted a few elements, it's the default configuration from your documentation. However, I noticed 2 problems:

The following extensions cannot load :

When looking at the console, I see lots of 404 errors on the cdn.tiny.cloud, and the messages:

Failed to load plugin: advlist autolink lists link image charmap print preview anchor from url plugins/advlist autolink lists link image charmap print preview anchor/plugin.min.js

and

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' .tinymce.com .tiny.cloud https:". Either the 'unsafe-inline' keyword, a hash ('sha256-O54ofw+GT0llr7Stt8/ICH/2tWUzm7YKv4Y/4GwwnY8='), or a nonce ('nonce-...') is required to enable inline execution.

Please tell me if you need more infos

Sklico commented 2 years ago

Hey @Drillan767, we have updated our README file, please check it for more info. There are some changes in config file for TinyMCE v6, e.g. plugins are not an array, but string, styleselect is now styles, print and paste plugins are removed etc. I also updated CSP section in README.

Drillan767 commented 2 years ago

Hello, thanks for these infos, it works now!