Use this extension to render Image element. This extension extend from @tiptap/extension-image.
Paste images can be uploaded automatically.
Custom HTML attributes that should be added to the rendered HTML tag.
Image.configure({
HTMLAttributes: {
class: "my-custom-class",
},
});
If you need to internationalize this extension, you can use this option.
Image.configure({
dictionary: {
name: "Image",
empty: "Add image",
error: "Error loading image",
loading: "Loading image...",
inputSrc: "Enter or paste link",
inputAlt: "Image description",
inputTitle: "Image title",
imageOpen: "Open image",
imageUpload: "Upload image",
imageDelete: "Delete image",
alignLeft: "Left alignment",
alignCenter: "Center alignment",
alignRight: "Right alignment",
},
});
Whether to set the audio extension to inline mode.
Image.configure({
inline: false,
});
Insert a new audio element.
editor.commands.setImage({
src: "https://example.com",
alt: "example alt",
title: "example title",
align: "center",
width: "100px"
});
[example alt](https://example.com "example title")
[example alt](https://example.com "example title")