Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 1023 Bytes

details.md

File metadata and controls

79 lines (54 loc) · 1023 Bytes

Details extension

Use this extension to render Details element. This is great to show and hide content.

Options

HTMLAttributes

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

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

dictionary

If you need to internationalize this extension, you can use this option.

Details.configure({
  dictionary: {
    name: "Details",
  },
});

Commands

setDetails()

Wrap content in a details node.

editor.commands.setDetails();

unsetDetails()

Unwrap a details node.

editor.commands.unsetDetails();

toggleDetails()

Wrap content in a details node or unwrap a details node.

editor.commands.toggleDetails();

InputRules

:::details

Markdown

::::details{open="true"}
:::detailsSummary
details summary 

**bold**
:::

:::detailsContent
details content

**bold**
:::
::::