How to add target={_blank} to all editor links by default?

492 Views Asked by At

I want all my editor links to open in a new tab with target={blank}

From documentation I did not find a way to do it!

Ι have add the LinkEditor implementation, but I don't understand from documentation-api where to add setTarget attribute to LinkNode

1

There are 1 best solutions below

3
gikall On BEST ANSWER

Finally I found it, and it is what I want! I leave it here for anyone else with the same worry.

I replaced editor.dispatchCommand(TOGGLE_LINK_COMMAND, linkUrl) with editor.dispatchCommand(TOGGLE_LINK_COMMAND, { url: linkUrl, target: '_blank' }) at the point which I set the link to editor!