fix: lastnodewastext in ssr

This commit is contained in:
Jonathan Kelley committed 2022-01-07 00:36:13 -05:00
1 parent bbb6ee10de
commit dbb6e9b4fe
1 file changed
+4 -13
+4 -13
View File
@@ -159,7 +159,8 @@ impl<'a> TextRenderer<'a, '_> {
write!(f, "{}", text.text)?
}
VNode::Placeholder(_anchor) => {
//
*last_node_was_text = false;
if self.cfg.indent {
for _ in 0..il {
write!(f, " ")?;
@@ -168,6 +169,8 @@ impl<'a> TextRenderer<'a, '_> {
write!(f, "<!-- -->")?;
}
VNode::Element(el) => {
*last_node_was_text = false;
if self.cfg.indent {
for _ in 0..il {
write!(f, " ")?;
@@ -205,18 +208,6 @@ impl<'a> TextRenderer<'a, '_> {
}
}
// // we write the element's id as a data attribute
// //
// // when the page is loaded, the `querySelectorAll` will be used to collect all the nodes, and then add
// // them interpreter's stack
// if let (true, Some(id)) = (self.cfg.pre_render, node.try_mounted_id()) {
// write!(f, " dioxus-id=\"{}\"", id)?;
// for _listener in el.listeners {
// // todo: write the listeners
// }
// }
match self.cfg.newline {
true => writeln!(f, ">")?,
false => write!(f, ">")?,