Inline link tool, open in new window option
I would like to add a 'open in new window' checkbox to the inline link tool. this would add target="_blank" to the element. How can I overwrite the default inline link tool? I think this would be a very useful standard feature for the inline link tool.
Also faced this issue but quickly managed to fix it with JS. Built in would be nice though.
const links = document.getElementsByTagName('a');
for (let link of links) {
link.setAttribute('target', '_blank')
link.setAttribute('rel', 'noopener')
link.setAttribute('aria-label', 'External link (opens in new tab)')
}
@sietseveenman hi! it will be added in the next 2.17 release
@khaydarov awesome new release! But I think my issue was misunderstood. I would like to add a checkbox input to the Inline tool (see screenshot). It would be great to have an option to add target="_blank" to the link created in the text

In 2.17 we have resolved #1028, not this issue.
In 2.17 we have resolved #1028, not this issue.
Thanks neSpecc. I am working an a custom inline toolbar button to add the target="_blank". That will be fine for now but it would be great to have this functionality baked in to the inline link tool.
Hi @neSpecc, hi @sietseveenman.
We had the same issue and created our own Inline "Link" Tool based on the current implementation (https://github.com/codex-team/editor.js/blob/master/src/components/inline-tools/inline-tool-link.ts).
It looks like this now:

I share the code with anyone interested: https://gist.github.com/natterstefan/0e6c22ed7af59c221b8a80e68b5cdb22
Hey @natterstefan That is exactly what I meant, looks good! Do you intent to use the 'title' input to add a title="yadadoodle" to the link for when the user hovers the link?
@neSpecc This would be a great standard feature imho
Hi @sietseveenman,
thank you very much.
Do you intent to use the 'title' input to add a title="yadadoodle" to the link for when the user hovers the link?
Yes, exactly.
@neSpecc, let me know, if I can be of help. Check out the gist for more details.
+1 for this feature request :) I've currently fixed this by explicitly adding the '_blank' property to all links. At the moment I'm usually linking to pdfs so thats fine. But obviously it would be better to make the blank property optional with some kind of checkbox as proposed by @natterstefan
@neSpecc would it be possible to set a default target for all links? i would like all links to have target="_blank"