#[non_exhaustive]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 (Non-exhaustive)§
This enum is marked as non-exhaustive
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).
Class membership is stored meaning, not presentation: promoting an
open-set tag into this class starts unioning adjacent runs that
round-tripped as two marks, so the promotion moves the canonical bytes of
documents nobody edited (DOCUMENT_STORAGE.md § Promoting a vocabulary
member).
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.
A new variant takes the slot immediately before MarkKind::Unknown,
pushing Unknown up by one. That is the only placement where a build that
knows the type and a build that reads it as Unknown order it identically
against every built-in; anywhere else is two canonical forms for one
document, one per reader (DOCUMENT_STORAGE.md § Promoting a vocabulary
member). The block axes sort by nothing, so the rule is the mark axis’
alone.
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).