cmark_writer/ast/html.rs
1//! HTML element definitions for the CommonMark AST.
2
3use super::node::Node;
4
5/// Represents an HTML attribute, containing name and value
6#[derive(Debug, Clone, PartialEq)]
7pub struct HtmlAttribute {
8 /// Attribute name
9 pub name: String,
10 /// Attribute value
11 pub value: String,
12}
13
14/// Represents an HTML element, containing tag name, attributes, and child nodes
15#[derive(Debug, Clone, PartialEq)]
16pub struct HtmlElement {
17 /// Element tag name
18 pub tag: String,
19 /// Element attributes
20 pub attributes: Vec<HtmlAttribute>,
21 /// Element child nodes (can only contain inline nodes)
22 pub children: Vec<Node>,
23 /// Whether it's a self-closing tag (e.g. <img />)
24 pub self_closing: bool,
25}