1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use pest::Parser;
use pest_derive::Parser;
#[derive(Debug, Clone)]
pub enum Block {
Header(usize, Vec<Span>),
Paragraph(Vec<Span>),
Blockquote(Vec<Block>),
CodeBlock(Option<String>, String),
LatexBlock(String),
OrderedList(Vec<Vec<Block>>),
UnorderedList(Vec<Vec<Block>>),
Raw(String),
Hr,
}
#[derive(Debug, Clone)]
pub enum Span {
Break,
Text(String),
Code(String),
Link(String, String),
Image(String, String),
Emphasis(Vec<Span>),
Strong(Vec<Span>),
Latex(String),
}
|