pub enum MarkKind {
Strong,
Emph,
Underline,
Strike,
Code,
Link {
url: String,
},
Anchor {
id: String,
},
Unknown {
tag: String,
attrs: Value,
},
}Expand description
The mark set — open: an unknown kind round-trips as MarkKind::Unknown,
absorbed as a new type, never a changed semantics of a known one. Two
algebra classes: formatting is a property of a range (two coincident are
redundant); identity is a handle (two over the same range are two things).
Variants§
Strong
Emph
Underline
Strike
Code
Link
Anchor
A comment thread or stable anchor, carried by id and rebased across
edits like any position. The id is caller-supplied, unique per Content,
opaque and invariant while the mark lives; positions rebase, the id never
does, and moved-and-rewritten text drops the mark whole
(DOCUMENT_STORAGE.md § Anchor-id identity). No markdown projection
(omitted on export; survives via diff-rebase).
Unknown
Implementations§
Source§impl MarkKind
impl MarkKind
Sourcepub fn is_formatting(&self) -> bool
pub fn is_formatting(&self) -> bool
Formatting marks are a property of a range and union when coincident; identity/unknown marks are handles and never merge (Spike-A rules).
Sourcepub fn ord(&self) -> u8
pub fn ord(&self) -> u8
Total order over kinds for the canonical sort tie-break, after
(start, end). Stable across releases — part of the freeze.
Sourcepub fn attrs_key(&self) -> String
pub fn attrs_key(&self) -> String
Attribute tie-break string, appended after ord in the canonical sort so
two marks that differ only in attrs order deterministically. Also the
grouping key for same-kind union (two formatting marks union only when
this matches — e.g. two links union only at the same url).