2 years ago
Fri Aug 5, 2022 8:02pm PST
Ask HN: Best way to let a user create a link inside a text input
I'm developing a flowcharting tool which lets users enter text inside each node. I want to allow you to highlight a bit of text and make it a link, by entering a url. Much like google docs and most other popular text editors. For a v1 I implemented this using prosemirror [0] which is pretty straight forward. The downside is that prosemirror is highly complex and introduces a large dependency. It also requires you to store data in their custom format. I'm trying to find another library, or tips on rolling my own, for simple link creation so I don't have to pull in code for all the other fancy things prosemirror does.

Eventually I may add other rich text editing features, like hash tags, @ mentions, etc. But I would rather start simple and resort to prosemirror when I really need it.

[0] https://github.com/prosemirror

comments:
add comment
loading comments...