editorjs-hyperlink icon indicating copy to clipboard operation
editorjs-hyperlink copied to clipboard

Replace built-in inline `link` tool with Hyperlink

Open Grendaizo90 opened this issue 3 years ago • 2 comments

I tried to add your Hyperlink in my Strapi app (with strapi-plugin-react-editorjs), and after i did it, Hyperlink comes as additional tool in inline toolbox (with same icon) and seems like their behavior now is binded to each other. Now i'd like to fully replace built-in inline link tool with your Hyperlink. Do you have any ideas how can i do this?

I've added your extension through customTools.js as described HERE at the bottom of page (about extending)

I've read this issue and all links discussed in this thread, but didn't find a solution

Here's Hyperlink in inline toolbar Снимок экрана 2022-12-12 в 15 27 52

That's what happening when i click on link tool after Hyperlink: Снимок экрана 2022-12-12 в 15 37 09

Grendaizo90 avatar Dec 12 '22 12:12 Grendaizo90

I've found a workaround. In customTools.js i wrote:

hyperlink: {
    class: Hyperlink,
    // ... code here
},
// solution below
link: function() {}

Grendaizo90 avatar Dec 24 '22 21:12 Grendaizo90

@Grendaizo90 i think you just need to set inlineToolbar in the EditorJS config:

so instead of

new EditorJS({
    inlineToolbar: ['bold', 'italic', 'underline', 'link']

set this:

new EditorJS({
    inlineToolbar: ['bold', 'italic', 'underline', 'hyperlink']

bettysteger avatar Feb 01 '24 17:02 bettysteger