Initialize editor with links from plain text

Hello, I am quite new to this editor. Although I can find my way around the docs/source code and determine solutions I would like to ask advice for a proper manner to solve some issues I am having. I fear my solutions and not always the best approach :slight_smile: I have a plain text like this one: "Hello, this is the link". How can I initialize the editor with this content (let’s say in order for someone to edit it) and transform the url into an anchor? The content of the editor should be: “Hello, this is the link” This is the simple case, a more developed one should insert a preview there for the link. I guess this one can be done in plugin’s view method, but at this point the content is already in, the first case is more like a pre-processing of the initialize content that should be done modular (normal links, image urls, mailto, etc)

You’ll need some code to convert from a text string to a ProseMirror document. That could could simply create a paragraph with a text node, but it’ll probably want to do more intelligent things, like creating separate paragraphs for each line in the string. It could also run a URL-matching regexp over the text and convert URLs to link nodes.