summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/html/dom.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library/src/html/dom.rs')
-rw-r--r--crates/typst-library/src/html/dom.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/typst-library/src/html/dom.rs b/crates/typst-library/src/html/dom.rs
index 47bcf995..49ff37c4 100644
--- a/crates/typst-library/src/html/dom.rs
+++ b/crates/typst-library/src/html/dom.rs
@@ -165,6 +165,11 @@ cast! {
pub struct HtmlAttrs(pub EcoVec<(HtmlAttr, EcoString)>);
impl HtmlAttrs {
+ /// Creates an empty attribute list.
+ pub fn new() -> Self {
+ Self::default()
+ }
+
/// Add an attribute.
pub fn push(&mut self, attr: HtmlAttr, value: impl Into<EcoString>) {
self.0.push((attr, value.into()));