Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 1.27 KB

embed.md

File metadata and controls

76 lines (55 loc) · 1.27 KB

Embed extension

This extension adds a new embed node to the editor.

Options

HTMLAttributes

Custom HTML attributes that should be added to the rendered HTML tag.

Embed.configure({
  HTMLAttributes: {
    class: "my-custom-class",
  },
});

dictionary

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",
  },
});

inline

Whether to set the embed extension to inline mode.

Embed.configure({
  inline: false,
});

items

You can write your own embed rules for different sites, see the TypeScript definitions for details on how to use them.

Commands

setEmbed()

Insert a new embed element.

editor.commands.setEmbed({
  src: "https://example.com",
  align: "center",
  width: "100px",
  height: "100px"
});

InputRules

:embed{https://example.com}

Markdown

:embed{https://example.com}