ipsae-core 0.1.0

markdown parser for DIY lover
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{Markdown, MarkdownType};

pub trait Visitor {
    fn visit(&self, style: MarkdownType, content: &str) -> Markdown;
}

#[derive(Copy, Clone)]
pub struct VisitorBase;

impl Visitor for VisitorBase {
    fn visit(&self, style: MarkdownType, content: &str) -> Markdown {
        return Markdown {
            style: style.into(),
            content: content.to_string(),
            children: vec![],
        }
    }
}