From 1b7ddd5894c2636618e630f44b1bb7d598d29b48 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sat, 3 Oct 2026 14:14:31 -0400 Subject: Planning for 0.2 --- src/compile.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/compile.rs') diff --git a/src/compile.rs b/src/compile.rs index 9e19b18..a0877cd 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -1,6 +1,9 @@ use html_escape::{encode_double_quoted_attribute, encode_single_quoted_attribute}; -use crate::analyze::{ConstantExpression, ConstantSymbolId, ConstantValue, ScopedSymbolTable}; +use crate::{ + VOID_TAGS, + analyze::{ConstantExpression, ConstantLiteral, ConstantSymbolId, ScopedSymbolTable}, +}; fn symbol_table_from_path<'a>( symbol_table: &'a ScopedSymbolTable<'a>, @@ -62,7 +65,7 @@ fn compile_constant<'a>( }; match expression { ConstantExpression::Value(value) => match value { - ConstantValue::String(value) => buffer.push_str(value), + ConstantLiteral::String(value) => buffer.push_str(value), }, ConstantExpression::Name(name) => { let mut name = *name; @@ -97,10 +100,12 @@ fn compile_constant<'a>( compile_attribute_value(buffer, symbol_table, name, *value); } buffer.push('>'); - compile_constant(buffer, symbol_table, *child); - buffer.push_str("'); + if !VOID_TAGS.contains(tag_name_lowercase) { + compile_constant(buffer, symbol_table, *child); + buffer.push_str("'); + } } } } -- cgit v1.3.1