nshenderov/strapi-plugin-ckeditor

edit existing schema of link to allow at $root

Benman2005 opened this issue · 1 comments

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?

Hey @Benman2005

You can't configure the model and schema in the config.
As far as I know ckeditor 5 wraps everything in a paragraph by default and there's no easy way to change it.