Back to API Reference
Class

TagHtmlClipboardAdapter

sealed

HTML clipboard adapter. Converts between the selection's span model and the Html external format using the per-type schemas registered in ClipboardModifierBindMap (Html).

Remarks

Copy renders the attributed document's shared visible-text-and-spans model — each span resolves its HTML schema by modifier identity, so whatever syntax authored the styling (tags or markers), the HTML carries it. On paste every modifier that declares an HTML schema contributes the mapping HTML element name(s) → the style's rule; the map covers only the formats the field has a style for; elements with no mapping are stripped, their inner content survives. Priority is 50: UniTextSourceClipboardAdapter (100, perfect-fidelity) wins for UniText → UniText pastes; HTML wins over plain text for paste from external rich-text apps (Word, Notion, Slack, Chrome) and from UniText into them. Paste input is treated as hostile per ClipboardBudget: the parser is a single-pass tokenizer with an explicit open-element stack (no recursion, no rescans), oversized payloads degrade to the same pass with no element map (plain text out), and nesting past the depth cap flattens. Inter-element whitespace collapses to one space the way CSS renders it (literal only inside <pre>), so pretty-printed Word / Outlook CF_HTML pastes without spurious blank lines and indent runs.
public ClipboardFormat Format{ get }
public int Priority{ get }
public string SerializeCopy()
public ClipboardPasteContent DeserializePaste()
public static readonly TagHtmlClipboardAdapter Instance

Shared stateless instance. Map building reads the editor passed in via context.