html_ast/node/
mod.rs

1mod display;
2
3use crate::HtmlElement;
4use std::{
5    borrow::Cow,
6    fmt::{Display, Formatter},
7};
8
9#[derive(Clone, PartialEq, Eq)]
10pub enum HtmlNode {
11    /// A doctype.
12    Doctype(DocType),
13    /// A comment.
14    Comment(String),
15    /// Text.
16    Text(Cow<'static, str>),
17    /// An element.
18    Element(HtmlElement),
19    /// A processing instruction.
20    ProcessingInstruction(ProcessingInstruction),
21}
22
23/// A doctype.
24#[derive(Clone, PartialEq, Eq)]
25pub struct DocType {
26    /// The doctype name.
27    pub name: String,
28    /// The doctype public ID.
29    pub public_id: String,
30    /// The doctype system ID.
31    pub system_id: String,
32}
33
34/// HTML Processing Instruction.
35#[derive(Debug, Clone, PartialEq, Eq)]
36pub struct ProcessingInstruction {
37    /// The PI target.
38    pub target: String,
39    /// The PI data.
40    pub data: String,
41}