diff options
| author | Mica White <botahamec@outlook.com> | 2026-10-03 14:14:31 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-10-03 14:14:31 -0400 |
| commit | 1b7ddd5894c2636618e630f44b1bb7d598d29b48 (patch) | |
| tree | 23634f9a1e95a719628b5978c834d1c7de69e615 /src/compile.rs | |
| parent | 67083043f5da93c447468578c49ffec1a679f1cc (diff) | |
Planning for 0.2
Diffstat (limited to 'src/compile.rs')
| -rw-r--r-- | src/compile.rs | 17 |
1 files changed, 11 insertions, 6 deletions
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("</"); - buffer.push_str(tag_name_lowercase); - buffer.push('>'); + if !VOID_TAGS.contains(tag_name_lowercase) { + compile_constant(buffer, symbol_table, *child); + buffer.push_str("</"); + buffer.push_str(tag_name_lowercase); + buffer.push('>'); + } } } } |
