pub enum MarkOp {
Add {
start: Usv,
end: Usv,
kind: MarkKind,
},
Remove {
start: Usv,
end: Usv,
kind: MarkKind,
},
RemoveAnchor {
id: String,
},
}Expand description
A mark edit in final-text coordinates (post-delta, post-line-op).
Variants§
Add
Add a mark over [start, end). An anchor kind must carry a non-empty
id not already live in the field — ids are caller-supplied and unique
per Content (DOCUMENT_STORAGE.md § Anchor-id identity); a collision or
the empty id is rejected (ApplyError::AnchorIdCollision /
ApplyError::EmptyAnchorId), never replaced or coexisted.
Remove
Un-format kind over [start, end): subtract the range from each
overlapping same-kind formatting mark, keeping the non-overlapping
fragments (a mid-run removal punches a hole; normalize drops any
zero-width fragment an edge-aligned removal leaves). Non-formatting
(identity/unknown) handles can’t be range-fragmented, so an overlapping
one is dropped whole — anchors normally go through MarkOp::RemoveAnchor.
RemoveAnchor
Drop one identity anchor by id.