markdown_it/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 { content, ext: RootExtSet::new() }
14 }
15}
16
17impl NodeValue for Root {
18 fn render(&self, node: &Node, fmt: &mut dyn Renderer) {
19 fmt.contents(&node.children);
20 }
21}