Skip to content
Anjunar/ DOCS

Clipboard

Clipboard content is a document fragment, validated against the receiving schema before insertion.

Concept

Structured paste

The browser port handles copy, cut and paste. ClipboardExtension inserts fragments through transactions, so pasted nodes receive valid IDs and participate in history.

Copy between paragraphs

Copy formatted text, paste it elsewhere, and compare the tree or Markdown view.

Copy this formatted phrase into the next paragraph.

Paste here.

10 words · 7 nodes
Copy this **formatted phrase** into the next paragraph. Paste here.
Source

Clipboard commands

The Paste payload is a DocumentFragment; deleting a selection is a separate command.

scala
val extension = new ClipboardExtension(generator) session.dispatch(ClipboardCommands.Paste, validatedFragment) session.dispatch(ClipboardCommands.DeleteSelection)