pub struct ParsedBlock {Show 15 fields
pub spans: Vec<ParsedSpan>,
pub heading_level: Option<i64>,
pub list_style: Option<ListStyle>,
pub list_indent: u32,
pub list_prefix: String,
pub list_suffix: String,
pub marker: Option<MarkerType>,
pub is_code_block: bool,
pub code_language: Option<String>,
pub blockquote_depth: u32,
pub line_height: Option<i64>,
pub non_breakable_lines: Option<bool>,
pub direction: Option<TextDirection>,
pub background_color: Option<String>,
pub alignment: Option<Alignment>,
}Expand description
A parsed block (paragraph, heading, list item, code block)
Fields§
§spans: Vec<ParsedSpan>§heading_level: Option<i64>§list_style: Option<ListStyle>§list_indent: u32§list_prefix: StringOrdered-list delimiter prefix (e.g. "(" for djot (1) lists; empty
otherwise). Stored on the List entity for round-trip fidelity.
list_suffix: StringOrdered-list delimiter suffix ("." for 1., ")" for 1)/(1);
empty for unordered lists).
marker: Option<MarkerType>Task-list checkbox marker (djot - [ ] / - [x]). Maps to
Block.fmt_marker. None for non-task blocks.
is_code_block: bool§code_language: Option<String>§blockquote_depth: u32§line_height: Option<i64>§non_breakable_lines: Option<bool>§direction: Option<TextDirection>§background_color: Option<String>§alignment: Option<Alignment>Paragraph alignment (djot {alignment=left|right|center|justify}). Maps
to Block.fmt_alignment. None when no alignment attribute is present.
Implementations§
Source§impl ParsedBlock
impl ParsedBlock
Sourcepub fn is_inline_only(&self) -> bool
pub fn is_inline_only(&self) -> bool
Returns true when this block carries no block-level formatting,
meaning its content is purely inline.
Trait Implementations§
Source§impl Clone for ParsedBlock
impl Clone for ParsedBlock
Source§fn clone(&self) -> ParsedBlock
fn clone(&self) -> ParsedBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedBlock
impl RefUnwindSafe for ParsedBlock
impl Send for ParsedBlock
impl Sync for ParsedBlock
impl Unpin for ParsedBlock
impl UnsafeUnpin for ParsedBlock
impl UnwindSafe for ParsedBlock
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
Mutably borrows from an owned value. Read more