-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: emit clickLink from
ReadOnlyEditor
The Prosemirror plugin with the `handleClick` handler only customizes the prosemirror handling of the click event. In read only mode we are not in a content-editable section. So clicking a link will cause the browser to open the url with a page reload. Allow overwriting this behavior by handling all link clicks via prosemirror. Set `onClick` option on the `Link` mark to customize the behavior. Emit a `click-link` event from `ReadOnlyEditor` with info about the event and the attributes of the link mark. Find the link that was clicked based on the clicked marks rather than the element in the event. This way we can get access to the attributes of the mark without relying on the selection or even changing it. Also add plugin key to link click handler Signed-off-by: Max <max@nextcloud.com>
- Loading branch information
1 parent
0b7b0d6
commit 5bf15b4
Showing
5 changed files
with
93 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters