insert image with link #1014
Replies: 6 comments 14 replies
-
I have the same problem, and I tried |
Beta Was this translation helpful? Give feedback.
-
Hey @manogi I came across a solution - I use
So if the Then, I create a separate Node type (not a Mark) specifically for the image links. The important part is to set the content type to your Image node type (my image nodes are called
It was weird that I had to add the filter to This works for me to add links around images when the HTML already has linked images. I've not tried adding links to images with commands, but hopefully there is a way! Let me know if it works or if you have come across a better way. |
Beta Was this translation helpful? Give feedback.
-
For anyone else who ends up here, I followed what @GraemeFulton did and then basically copied the command structure of the block quote extension (https://github.com/ueberdosis/tiptap/blob/main/packages/extension-blockquote/src/blockquote.ts) except wrapping, toggling, and lifting the |
Beta Was this translation helpful? Give feedback.
-
it's old discussion , but i wonder how can i solve this problem? |
Beta Was this translation helpful? Give feedback.
-
Tiptap 2.0.4 https://tiptap.dev/api/nodes/image#inline Image.configure({
inline: true,
}) |
Beta Was this translation helpful? Give feedback.
-
Guys, I got it working! 🎉 ed.chain().focus()
.setImage({ src: imageUrl })
.selectParentNode()
.setLink({ href: imageUrl })
.run() with Image.configure({
inline: true,
}) |
Beta Was this translation helpful? Give feedback.
-
Hi, I have a custom component to insert a image and I used with the editor, now I have to add a link to that image but I cant figure out how to do that
I want to have something like this
<a href=""><img src="" alt=""></a>
I tried to call the link command after insert the image but it doent work
Beta Was this translation helpful? Give feedback.
All reactions