Using linkify

Hi everyone,

I’m trying to find a way to display clickable links in a text area. I came across a library called linkifyjs and I would like to pair it up with code mirror. Has anyone done something similar to this and can offer suggestions?

Adrian

That won’t work. If you have external code messing with CodeMirror’s DOM, that will break the editor. In general, you can’t have links inside of the editor, though you can style URLs specially (using a mode or overlay), detect clicks on them, and run your own code when this happens.

thanks @marijn for getting back to me. That’s an interesting approach.

The use case for this is in a mobile browser. I need a simple text editor that only needs to detect urls in strings as the user types and make them look like links. I’ve looked at other editors like tinymce, etc, but their insert links functionality is through a button.