Customize ckeditor 5 Link

Hi everybody,

I added the ckeditor 5 to my strapi project by the strapi market with the following command:

npm install @_sh/strapi-plugin-ckeditor

Then I only have this on my plugins.js file:

ckeditor5: {
    enabled: true,
  },

The problem is that the Hyperlinks are not working as I expected, for both cases, If I want to open the URL in a new tab or in the same tab I have the same result (opens in a new tab)

Screen Shot 2024-03-25 at 17.15.39

so I’m trying to change some configuration of the Link like adding something like this for example (only for testing):

 link : {
   addTargetToExternalLinks: false
 },

But I don’t know where to add it or if I have to extend the plugin, or if anyone has experienced this problem, I would appreciate your help

Thanks in advance.

even im facing the same issue any updates on this

If you are using the ckeditor5 from the strapi plugin extensions, the solution is create a ckeditor.txt in config folder and add this code:

globalThis.CKEditorConfig = {
  configs:{
    toolbar:{
      editorConfig:{
        link: {
          decorators: [
            {
              mode: 'manual',
              label: 'Open in a new tab',
              attributes: {
                target: '_blank',
                rel: 'noopener noreferrer',
              }
            },
            {
              mode: 'manual',
              label: 'Downloadable',
              attributes: {
                download: 'download'
              }
            }
          ]
        }
      }
    }
  }
}

Hi, I created ckeditor.txt in ./config folder, but I don’t see any changes in editor. Any ideas what I do wrong? Even labels are not changed


e

Hey, Hmm give me more information about your strapi version and ckeditor version that you have installed