summaryrefslogtreecommitdiff
path: root/src/block.rs
blob: 2a34fcf8130ed63f574814e27d2e703338571c7f (plain) (blame)
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 crate::{Line, Table};

pub enum Block {
    Heading1(Line),
    Heading2(Line),
    Heading3(Line),
    Paragraph(Line),
    List(Vec<Line>),
    Quote(Vec<Line>),
    Code(String, Vec<String>),
    Table(Table),
}
impl std::fmt::Debug for Block {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        f.write_str(match self {
            Self::Heading1(_) => "Heading1",
            Self::Heading2(_) => "Heading2",
            Self::Heading3(_) => "Heading3",
            Self::Paragraph(_) => "Paragraph",
            Self::List(_) => "List",
            Self::Quote(_) => "Quote",
            Self::Code(_, _) => "Code",
            Self::Table(_) => "Table",
        })
    }
}