nshenderov / strapi-plugin-ckeditor

Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Unofficial integration)
https://www.npmjs.com/package/@_sh/strapi-plugin-ckeditor
MIT License
84 stars 53 forks source link

edit existing schema of link to allow at $root #145

Open Benman2005 opened 1 month ago

Benman2005 commented 1 month ago

I'm trying to extend the link model of ckeditor to allow it at $root. This way, my tags wouldnt always be wrapped in paragraphs I believe.

I'm not sure where to extend these settings using strapi-plugin-ckeditor v1.1.3.

I now have this in my strapi/config/plugins.js:

module.exports = ({ env }) => ({
  ckeditor: {
    enabled: true,
    config: {
      editor: {
        link: {
          schema: {
            allowWhere: ["$root", "$container", "$block"],
            allowIn: ["$root"],
            isBlock: true,
          },
        },
        model: {
          schema: {
            extend:
              ("link",
              {
                allowWhere: ["$root", "$container", "$block"],
                allowIn: ["$root"],
                isBlock: true,
              }),
            link: {
              allowWhere: ["$root"],
              allowIn: ["$root"],
              isBlock: true,
            },
          },
        },
      },
    },
  },
});

This does not work. Is there anything i'm missing that i should do? How can I extend the behavior of a link using the config file? Or should i go beyond the config?