|
@@ -156,11 +156,20 @@ impl StringCache {
|
|
cur_path.pop();
|
|
cur_path.pop();
|
|
}
|
|
}
|
|
TemplateNode::Text { text } => {
|
|
TemplateNode::Text { text } => {
|
|
|
|
+ // write the id if we are prerendering and this is a root node that may need to be removed in the future
|
|
|
|
+ if prerender && is_root {
|
|
|
|
+ write!(chain, "<!--node-id")?;
|
|
|
|
+ chain.segments.push(Segment::RootNodeMarker);
|
|
|
|
+ write!(chain, "-->")?;
|
|
|
|
+ }
|
|
write!(
|
|
write!(
|
|
chain,
|
|
chain,
|
|
"{}",
|
|
"{}",
|
|
askama_escape::escape(text, askama_escape::Html)
|
|
askama_escape::escape(text, askama_escape::Html)
|
|
)?;
|
|
)?;
|
|
|
|
+ if prerender && is_root {
|
|
|
|
+ write!(chain, "<!--#-->")?;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
TemplateNode::Dynamic { id: idx } | TemplateNode::DynamicText { id: idx } => {
|
|
TemplateNode::Dynamic { id: idx } | TemplateNode::DynamicText { id: idx } => {
|
|
chain.segments.push(Segment::Node(*idx))
|
|
chain.segments.push(Segment::Node(*idx))
|