mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
This commit is contained in:
parent
8847d5fc42
commit
f837d3e6a2
2 changed files with 19 additions and 4 deletions
|
@ -405,11 +405,14 @@ impl View {
|
|||
self,
|
||||
dont_escape_text: bool,
|
||||
) -> Cow<'static, str> {
|
||||
println!("render_to_string_helper {:?}", self);
|
||||
match self {
|
||||
View::Text(node) => {
|
||||
if dont_escape_text {
|
||||
println!("don't escape {:?}", node.content);
|
||||
node.content
|
||||
} else {
|
||||
println!("encode_safe {:?}", node.content);
|
||||
html_escape::encode_safe(&node.content).to_string().into()
|
||||
}
|
||||
}
|
||||
|
@ -492,9 +495,17 @@ impl View {
|
|||
// browser create the dynamic text as it's own text node
|
||||
if let View::Text(t) = child {
|
||||
if !cfg!(debug_assertions) {
|
||||
format!("<!>{}", t.content).into()
|
||||
format!(
|
||||
"<!>{}",
|
||||
html_escape::encode_safe(
|
||||
&t.content
|
||||
)
|
||||
)
|
||||
.into()
|
||||
} else {
|
||||
t.content
|
||||
html_escape::encode_safe(&t.content)
|
||||
.to_string()
|
||||
.into()
|
||||
}
|
||||
} else {
|
||||
child.render_to_string_helper(
|
||||
|
|
|
@ -438,12 +438,16 @@ impl View {
|
|||
StreamChunk::Sync(
|
||||
format!(
|
||||
"<!>{}",
|
||||
content
|
||||
html_escape::encode_safe(
|
||||
&content
|
||||
)
|
||||
)
|
||||
.into(),
|
||||
)
|
||||
} else {
|
||||
StreamChunk::Sync(content)
|
||||
StreamChunk::Sync(html_escape::encode_safe(
|
||||
&content
|
||||
).to_string().into())
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue