pub enum Mark {
Bold,
Italic,
Underline,
Strikethrough,
Code,
Superscript,
Subscript,
Link {
href: String,
title: Option<String>,
},
Anchor {
id: String,
},
Footnote {
number: u32,
id: Option<String>,
},
Math {
format: MathFormat,
source: String,
},
Extension(ExtensionMark),
}Expand description
Formatting marks that can be applied to text.
Marks represent inline formatting such as bold, italic, links, etc. Multiple marks can be applied to the same text node.
§Serialization
Simple marks (Bold, Italic, etc.) serialize as plain strings: "bold".
Complex marks (Link, Math, etc.) serialize as objects with a "type" field.
Extension marks serialize with their namespaced type as "type".
Variants§
Bold
Bold/strong text.
Italic
Italic/emphasized text.
Underline
Underlined text.
Strikethrough
Strikethrough text.
Code
Inline code (monospace).
Superscript
Superscript text.
Subscript
Subscript text.
Link
Hyperlink.
Anchor
Named anchor mark for creating anchor points in text.
Footnote
Footnote reference mark (semantic extension).
Links text to a footnote block elsewhere in the document.
Fields
Math
Inline mathematical expression.
Fields
format: MathFormatMath format (latex or mathml).
Extension(ExtensionMark)
Extension mark for custom/unknown mark types.
Extension marks use namespaced types like “semantic:citation” or “legal:cite”. This enables extensions to add custom inline marks without modifying the core Mark enum.
Implementations§
Source§impl Mark
impl Mark
Sourcepub fn is_extension(&self) -> bool
pub fn is_extension(&self) -> bool
Check if this mark is an extension mark.
Sourcepub fn as_extension(&self) -> Option<&ExtensionMark>
pub fn as_extension(&self) -> Option<&ExtensionMark>
Get the extension mark if this is one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Mark
impl<'de> Deserialize<'de> for Mark
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for Mark
impl StructuralPartialEq for Mark
Auto Trait Implementations§
impl Freeze for Mark
impl RefUnwindSafe for Mark
impl Send for Mark
impl Sync for Mark
impl Unpin for Mark
impl UnsafeUnpin for Mark
impl UnwindSafe for Mark
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.