summaryrefslogtreecommitdiff
path: root/crates/typst-html/src/encode.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-06-23 14:22:09 +0200
committerLaurenz <laurmaedje@gmail.com>2025-06-23 14:22:09 +0200
commit9050ee1639a20463e3cafce58964c9ef0fa38205 (patch)
tree7fbb132c4bb3e217d8898d052b68ba4265835e1f /crates/typst-html/src/encode.rs
parentc1b2aee1a941f49d5eb8c04c9b19841dbeb1b27d (diff)
Turn non-empty void element into export error
Diffstat (limited to 'crates/typst-html/src/encode.rs')
-rw-r--r--crates/typst-html/src/encode.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/typst-html/src/encode.rs b/crates/typst-html/src/encode.rs
index eb25ab1e..2bfa78a7 100644
--- a/crates/typst-html/src/encode.rs
+++ b/crates/typst-html/src/encode.rs
@@ -89,6 +89,9 @@ fn write_element(w: &mut Writer, element: &HtmlElement) -> SourceResult<()> {
w.buf.push('>');
if tag::is_void(element.tag) {
+ if !element.children.is_empty() {
+ bail!(element.span, "HTML void elements must not have children");
+ }
return Ok(());
}