Clickable links

Hi !

I am new to prosemirror, and I’m trying to understand all the documentation :slight_smile: Excuse me if my question is not appropriate or too basic…

Right now I’m trying to get the hang of the API and how to configure my editor.

I have a question for users who have already built their environment: how do you handle links in the document? Indeed, these are not clickable since the contentEditable attribute has been set to true in the root node that contains the editor.

What I want to do is to build a customNodeView element for the links - with a popin that would allow to edit the target and leave the link directly clickable in the document.

Has this already been implemented?

Thanks to you!

I’m not sure if there’s a good open implementation of this, but indeed, the common solution to this is to show a tooltip when the cursor is in the links, similar to the tooltip shown for marked text in the collab example.

Thanks Marijn !

This answer the second part of the question. For the first part, I think I just have to rewrite the toDOM function for links and set contenteditable attribute to false.

I will look further in the example !

No, that won’t really work—people wouldn’t be able to edit links anymore.

This hasn’t been an issue for me since you can still right click a link to open the context menu and navigate from there when contentEditable = true.

Thanks for all your answer. I think I’ll opt for the pop-in which will allow me to:

  1. edit the link itself (this is not possible in the default configuration)
  2. provide a clickable url

It is a good way to start the customisation :slight_smile: