#[derive(Debug, Clone, PartialEq)]
pub enum Node {
Document(Vec<Node>),
Heading {
level: u8,
content: Vec<Node>,
},
Paragraph(Vec<Node>),
BlockQuote(Vec<Node>),
CodeBlock {
language: Option<String>,
content: String,
},
UnorderedList(Vec<ListItem>),
OrderedList {
start: u32,
items: Vec<ListItem>,
},
ThematicBreak,
Table {
headers: Vec<Node>,
rows: Vec<Vec<Node>>,
alignments: Vec<Alignment>,
},
Link {
url: String,
title: Option<String>,
content: Vec<Node>,
},
Image {
url: String,
title: Option<String>,
alt: String,
},
Emphasis(Vec<Node>),
Strong(Vec<Node>),
Strike(Vec<Node>),
InlineCode(String),
Text(String),
Inline(Vec<Node>),
Html(String),
HtmlElement(HtmlElement),
SoftBreak,
HardBreak,
}
#[derive(Debug, Clone, PartialEq)]
pub struct ListItem {
pub content: Vec<Node>,
pub is_task: bool,
pub task_completed: bool,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Alignment {
None,
Left,
Center,
Right,
}
#[derive(Debug, Clone, PartialEq)]
pub struct HtmlAttribute {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct HtmlElement {
pub tag: String,
pub attributes: Vec<HtmlAttribute>,
pub children: Vec<Node>,
pub self_closing: bool,
}