html-types 0.4.0

HTML Data structures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::Html;
use crate::node::Node;

pub struct Document {
    pub html: Html,
}

impl<'a> From<Document> for String {
    fn from(value: Document) -> Self {
        let node: Node<'a> = value.html.into();
        let text: String = node.into();
        format!("<!DOCTYPE html>{}", text)
    }
}