Compare commits

...

1 Commits
4313 ... 4079

Author SHA1 Message Date
Greg Johnston
86b78640e7 fix: don't render a comment node for () attributes in template (closes #4079) 2025-06-13 22:48:18 -04:00
3 changed files with 21 additions and 1 deletions

View File

@@ -709,7 +709,7 @@ where
buf.push('<');
buf.push_str(E::TAG);
<At as ToTemplate>::to_template(
<At as ToTemplate>::to_template_attribute(
buf,
&mut class,
&mut style,

View File

@@ -437,6 +437,17 @@ pub trait ToTemplate {
inner_html: &mut String,
position: &mut Position,
);
/// Renders a view type to a template in attribute position.
fn to_template_attribute(
buf: &mut String,
class: &mut String,
style: &mut String,
inner_html: &mut String,
position: &mut Position,
) {
Self::to_template(buf, class, style, inner_html, position);
}
}
/// Keeps track of what position the item currently being hydrated is in, relative to its siblings

View File

@@ -103,6 +103,15 @@ impl ToTemplate for () {
) {
buf.push_str("<!>");
}
fn to_template_attribute(
_buf: &mut String,
_class: &mut String,
_style: &mut String,
_inner_html: &mut String,
_position: &mut Position,
) {
}
}
impl<A: Render> Render for (A,) {