This extension adds a new embed node to the editor.
Custom HTML attributes that should be added to the rendered HTML tag.
Embed.configure({
HTMLAttributes: {
class: "my-custom-class",
},
});
If you need to internationalize this extension, you can use this option.
Embed.configure({
dictionary: {
name: "Embed",
inputEmbed: "Enter or paste embed",
openEmbed: "Open embed",
deleteEmbed: "Delete embed",
alignLeft: "Left alignment",
alignCenter: "Center alignment",
alignRight: "Right alignment",
},
});
Whether to set the embed extension to inline mode.
Embed.configure({
inline: false,
});
You can write your own embed rules for different sites, see the TypeScript definitions for details on how to use them.
Insert a new embed element.
editor.commands.setEmbed({
src: "https://example.com",
align: "center",
width: "100px",
height: "100px"
});
:embed{https://example.com}
:embed{https://example.com}