I’ve been trying to figure out how can I scan a document to find unmarked URLs in nodes. I ahve thought of two ways of tackling the problem:
- Going through the document tree myself and scanning the textContent value of Text nodes to find URLs and then splitting them up. This would be my last resort as I believe there’s probably a better way of achieving this through prosemirror transactions or the transform package
- Listen for spaces and check if the last word is URL. If so, mark it as a link. It’s a little different from the actual request but it achieves a similar result and if that’s easier to do I would go this route. Similar behaviour can be found on Bitbucket that uses prosemirror
I’ve been going through the documentation for sometime now and it seems definitely achievable just can’t see it. What do you believe is the best solution?
P.S. I’m also taking a look at the atlassian/prosemirror-utils package. It has some valuable functions but I’m not too sure if I need it.