Adding support for [[double bracket]] internal links #277
-
Hi there! Loving your editor, thanks for open sourcing :) I'm working on a project that uses bidirectional links similar to Roam Research and need to add the So if a user types I forked the main repo but figured it's worth reaching out to ask if you have specific advice on how to implement in accordance with project structure. If it's a feature you'd use, i'll happily PR into the main repo if/when it works, but i'm not very familiar with Prosemirror so advice is welcome |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, I'd be interested in accepting a PR for this shortcut. There's an existing onCreateLink callback, so you'd want to hook into this to create/find the link based on the text between the brackets. You can search the codebase to see how this is used currently from the LinkToolbar. The bracket matching can be done with an additional input rule: I'd hope that all of the associated logic could be contained within the |
Beta Was this translation helpful? Give feedback.
Hi, I'd be interested in accepting a PR for this shortcut.
There's an existing onCreateLink callback, so you'd want to hook into this to create/find the link based on the text between the brackets. You can search the codebase to see how this is used currently from the LinkToolbar.
The bracket matching can be done with an additional input rule:
https://github.com/outline/rich-markdown-editor/blob/develop/src/marks/Link.ts#L64
I'd hope that all of the associated logic could be contained within the
Link
mark file.