markdown_that/parser/core/
root.rs

1use crate::parser::extset::RootExtSet;
2use crate::{Node, NodeValue, Renderer};
3
4#[derive(Debug)]
5/// Root node of the AST.
6pub struct Root {
7    pub content: String,
8    pub ext: RootExtSet,
9}
10
11impl Root {
12    pub fn new(content: String) -> Self {
13        Self {
14            content,
15            ext: RootExtSet::new(),
16        }
17    }
18}
19
20impl NodeValue for Root {
21    fn render(&self, node: &Node, fmt: &mut dyn Renderer) {
22        fmt.contents(&node.children);
23    }
24}