pub struct Footnote {
pub number: u32,
pub id: Option<String>,
pub content: Option<String>,
pub children: Vec<Block>,
}Expand description
A footnote with content blocks.
Per the spec, footnotes support either content (plain text) or children
(rich content with blocks), but not both on the same footnote.
Fields§
§number: u32Sequential footnote number.
id: Option<String>Optional unique identifier for cross-referencing with footnote marks.
content: Option<String>Simple text content (for footnotes without complex formatting).
Mutually exclusive with children.
children: Vec<Block>Rich content blocks (paragraph blocks with formatting).
Mutually exclusive with content.
Implementations§
Source§impl Footnote
impl Footnote
Sourcepub fn with_content(self, content: impl Into<String>) -> Self
pub fn with_content(self, content: impl Into<String>) -> Self
Set the text content (simple footnotes without formatting).
Note: This is mutually exclusive with with_children. If both are
set, implementations should prefer children.
Sourcepub fn with_children(self, children: Vec<Block>) -> Self
pub fn with_children(self, children: Vec<Block>) -> Self
Set the rich content blocks (footnotes with formatting).
Note: This is mutually exclusive with with_content. If both are
set, implementations should prefer children.
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Check if this footnote has rich content (children).
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Check if this footnote has simple content.