-
I tried using the code from the playground but it does not work. Is it even possible with the current setup? Thanks ❤️ |
Beta Was this translation helpful? Give feedback.
Answered by
vimtor
Sep 2, 2021
Replies: 1 comment 1 reply
-
I ended up creating a custom Then for wrapping the image I just check if the selected node is an image and remove it and insert a new image link element from the plugin. Something like this: const [selectedNode] = getAbove(editor);
if (selectedNode?.type === 'img') {
Transforms.removeNodes(editor, { at: editor.selection });
insertImageLink(editor, { url: selectedNode?.url, href: url });
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vimtor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ended up creating a custom
imagePlugin
which renders a image wrapped in a link.Then for wrapping the image I just check if the selected node is an image and remove it and insert a new image link element from the plugin. Something like this: